学PHP必知PHP岗位面试题
<img src="https://mmbiz.qpic.cn/mmbiz_gif/LFP9SpGv0PHLLozvq190zniaHsyzAVDAeEBoj2HuoDIfbpdsAB2O3IUWHZxnKjiaj63NNOmQ7p2MKhfXhdmPkODw/640?wx_fmt=gif&tp=webp&wxfrom=5&wx_lazy=1" style="width: 50%; margin-bottom: 20px;"><p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">1.HTTP协议中几个状态码的含义:503 500 401 403 404 200 301 302.</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">答案:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">503 (服务不可用) 服务器<span style="color: black;">日前</span><span style="color: black;">没法</span><span style="color: black;">运用</span>(<span style="color: black;">因为</span>超载或停机<span style="color: black;">守护</span>)。<span style="color: black;">一般</span>,这只是暂时状态。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">500 (服务器内部错误) 服务器遇到错误,<span style="color: black;">没法</span>完成请求。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">401 (未授权) 请求<span style="color: black;">需求</span>身份验证。 <span style="color: black;">针对</span>需要登录的网页,服务器可能返回此响应。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">403 (禁止) 服务器拒绝请求。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">404 (未找到) 服务器找不到请求的网页。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">200 (成功) 服务器已成功处理了请求。 <span style="color: black;">一般</span>,这<span style="color: black;">暗示</span>服务器<span style="color: black;">供给</span>了请求的网页。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">301 (永久移动) 请求的网页已永久移动到新位置。 服务器返回此响应(对 GET 或 HEAD 请求的响应)时,会自动将请求者转到新位置。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">302 (临时移动) 服务器<span style="color: black;">日前</span>从<span style="color: black;">区别</span>位置的网页响应请求,但请求者应继续<span style="color: black;">运用</span>原有位置来进行以后的请求。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">2.include require include_once require_once的区别。</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">引用文件的<span style="color: black;">办法</span>有两种:require 及 include。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">require 的<span style="color: black;">运用</span><span style="color: black;">办法</span>如 require("file.php"); 。这个函数<span style="color: black;">一般</span>放在 PHP 程序的最前面,PHP 程序在执行前,就会先读入 require 所指定引入的文件,使它变成 PHP 程序网页的一部份。常用的函数,<span style="color: black;">也</span><span style="color: black;">能够</span>这个<span style="color: black;">办法</span>将它引入网页中。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">include <span style="color: black;">运用</span><span style="color: black;">办法</span>如 include("file.php"); 。这个函数<span style="color: black;">通常</span>是放在流程<span style="color: black;">掌控</span>的处理部分中。PHP 程序网页在读到 include 的文件时,才将它读进来。这种方式,<span style="color: black;">能够</span>把程序执行时的流程简单化。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">_once 后缀<span style="color: black;">暗示</span>已加载的不加载</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">3.请写出数据类型(int char varchar datetime text)的意思,请问varchar和char有什么区别。</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">int:整数类型,4 字节<span style="color: black;">体积</span>,范围(-2 147 483 648,2 147 483 647)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">char:字符串类型,<span style="color: black;">体积</span>0-255字节</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">varchar:字符串类型,<span style="color: black;">体积</span>0-65535 字节</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">datetime:<span style="color: black;">暗示</span>时间值的日期和时间类型,<span style="color: black;">体积</span>8个字节,格式:YYYY-MM-DD HH:MM:SS</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">text:字符串类型,0-65535字节,用于长文本数据存储</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">char与varchar的区别:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">char (13)长度固定, 如www.nynds.com 存储需要空间 13个字符</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">varchar(13) 可变长 如www.nynds.com 需要存储空间 14字符</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">从上面<span style="color: black;">能够</span>看得出来char 长度是固定的,不管你存储的数据是多少他都会都固定的长度。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">而varchar则处可变长度但他要在总长度上加1字符,这个用来存储位置。<span style="color: black;">因此</span><span style="color: black;">实质</span>应用中用户<span style="color: black;">能够</span><span style="color: black;">按照</span>自己的数据类型来做。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">因为</span>某种<span style="color: black;">原由</span>char 固定长度,<span style="color: black;">因此</span>在处理速度上要比varchar快速<span style="color: black;">非常多</span>。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">4.Mysql的存储引擎myisam和innodb的区别。</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">InnoDB和MyISAM是许多人在<span style="color: black;">运用</span>MySQL时最常用的两个表类型,这两个表类型各有优劣,视<span style="color: black;">详细</span>应用而定。基本的差别为:MyISAM类型不支持事务处理等高级处理,而InnoDB类型支持。MyISAM类型的表强调的是性能,其执行数度比InnoDB类型更快,<span style="color: black;">然则</span>不<span style="color: black;">供给</span>事务支持,而InnoDB<span style="color: black;">供给</span>事务支持以及<span style="color: black;">外边</span>键等高级数据库功能。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">5.echo(),print(),print_r()的区别</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">echo是PHP语句, print和print_r是函数,语句<span style="color: black;">无</span>返回值,函数<span style="color: black;">能够</span>有返回值(即便<span style="color: black;">无</span>用)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">print只能打印出简单类型变量的值(如int,string)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">print_r<span style="color: black;">能够</span>打印出<span style="color: black;">繁杂</span>类型变量的值(如数组,对象)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">倘若</span>你想和<span style="color: black;">更加多</span>PHP大神切磋交流经验,添加下方<span style="color: black;">微X</span>号,拉你入群</span></strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">倘若</span>你想<span style="color: black;">得到</span><span style="color: black;">更加多</span>学习资料,添加下方<span style="color: black;">微X</span>号,送你资源</span></strong></span></p><img src="https://mmbiz.qpic.cn/mmbiz_jpg/MvsGtlp1hRecpZctD8Rkb3viaUHQZPWkRQHu2a3Gic2TqTmBylibfj1mVN7axBfN1qrnHvL8k5YHHfa3gH80bfm8g/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">关注菲菲</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">带你入群,带你飞</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">更有资源免费送!</strong></span></p><span style="color: black;"><strong style="color: blue;">COME BABY</strong></span><img src="https://mmbiz.qpic.cn/mmbiz_png/MvsGtlp1hRecpZctD8Rkb3viaUHQZPWkRwdztpdwWUlu6LZHPON5V8AGDkJ03yKePhxCE7NeogjlQN8acx4iczHw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_gif/LFP9SpGv0PHLLozvq190zniaHsyzAVDAeHyyIJb7v8y3KzvtCibhC3H4KHgd2LurPt9eAYiaoia8W4HRKf1dic16Y2A/640?wx_fmt=gif&tp=webp&wxfrom=5&wx_lazy=1" style="width: 50%; margin-bottom: 20px;"></p>
我完全同意你的观点,说得太对了。 谷歌外链发布 http://www.fok120.com/
页:
[1]