php宝典_php面试宝典 - CSDN
精华内容
参与话题
  • PHP宝典面试笔试题目

    2018-12-08 12:37:15
    PHP宝典面试笔试题目 来自《PHP程序员面试笔试宝典》,涵盖了近三年了各大型企业常考的PHP面试题,针对面试题提取出来各种面试知识也涵盖在了本书。   PHP题目 【真题68】 ( )操作符在两个操作数中有一个...

    PHP宝典面试笔试题目

    来自《PHP程序员面试笔试宝典》,涵盖了近三年了各大型企业常考的PHP面试题,针对面试题提取出来各种面试知识也涵盖在了本书。

     

    PHP题目

    真题68】 (    )操作符在两个操作数中有一个(不是全部)为 True 时返回 True。

    参考答案:逻辑异或(xor)运算符。

     

    【真题61】 执行如下程序段:

    <?php

        echo 24%(-5);

    ?>

     

    程序的输出结果是(    )。

    A.5 B.4 C.-4 D.19

    参考答案:B。

    分析:在PHP中,取模运算符%的操作数在运算之前都会转换成整数(除去小数部分)。其运算结果和被除数的符号(正负号)相同。即$a%$b的结果和$a的符号相同。本题中,24%(-5)的符号为正,结果为4。所以,选项B正确。

     

    【真题181】 写一个函数,算出两个文件的相对路径。例如,$a = \/a/b/c/d/e.php\;,$b =  \/a/b/12/ 34/c.php\;,计算出 $b 相对于 $a 的相对路径应该是 ../../c/d。

    参考答案:示例代码如下:

    function getRelativepath($a, $b) {

    $returnpath = array(dirname($b));

    $arrA = explode(' \/\ ', $a);

    $arrB = explode(' \/\ ', $returnpath[0]);

    for ($n = 1, $len = count($arrB); $n < $len; $n++) {

    if ($arrA[$n] != $arrB[$n]) {

    break;

    }

    }

    if ($len - $n > 0) {

    $returnpath = array_merge($returnpath, array_fill(1, $len - $n, "\..\ "));

    }

    $returnpath = array_merge($returnpath, array_slice($arrA, $n));

    return implode(' \/\ ', $returnpath);

    }

    $a = "\/a/b/c/d/e.php\";

     

    $b = "\/a/b/12/34/c.php\";

    echo getRelativepath($a, $b);

     

     

    【真题182】 以下关于PHP文件处理的说法中,正确的是(    )。

    A.filegetcontents()函数能用来抓取网页数据,但是没办法设置超时时间

    B.file()函数既能读取文本文件也能读取二进制文件,但是读取二进制文件有可能出现安全问题

    C.如果表单中没有选择上传的文件,则 PHP 变量的值将为NULL

    D.fsockopen()和fputs()结合起来可以发送邮件,也可以用来抓取网页内容、下载ftp文件等

    参考答案:C。

    分析:对于选项A,可以通过context参数设置超时时间。所以,选项A错误。

    对于选项B,file()函数是可以安全用于读取二进制文件的。所以,选项B错误。

    对于选项C,表单中没有文件上传时,PHP的$_FILES变量值为NULL。所以,选项C正确。

    对于选项D,fputs()用于写入字符串到文件中,只能用于上传不能用于下载ftp文件。所以,选项D错误。

     

    【真题215】 按要求写出SQL实现。

    1)创建新闻发布系统,表名为message,有如下字段:

    id 文章id

    title 文章标题

    content 文章内容

    category_id 文章分类id

    hits 点击量

     

    参考答案:

    CREATE TABLE 'message'(

    'id' int(10) NOT NULL auto_increment,

    'title' varchar(200) default NULL,

    'content' text,

    'category_id' int(10) NOT NULL,

    'hits' int(20),

    PRIMARY KEY('id');

    )ENGINE=InnoDB DEFAULT CHARSET=utf8;

     

    2)同样上述新闻发布系统:表comment记录用户回复内容,字段如下:

    comment_id 回复id

    id 文章id,关联message表中的id

    comment_content 回复内容

     

    现通过查询数据库需要得到以下格式的文章标题列表,并按照回复数量排序,回复最高的排在最前面。

    文章id 文章 标题 点击量 回复 数量

     

    用一个SQL语句完成上述查询,如果文章没有回复,则回复数量显示为0。

    参考答案:

    SELECT message.id id,message.title title,IF(message.'hits' IS NULL,0,message. 'hits') hits,

    IF(comment. 'id' is NULL,0,count(*)) number FROM message LEFT JOIN

    comment ON message.id=comment.id GROUP BY message. 'id';

     

    上述内容管理系统,表category保存分类信息,字段如下:

    category_id int(4) not null auto_increment;

    category_name varchar(40) not null;

     

    3)用户输入文章时,通过选择下拉菜单选定文章分类,写出如何实现这个下拉菜单。

    参考答案:

    function categoryList()

    {

            $result=mysql_query("select category_id,categroy_name from category")

                or die("Invalid query: " . mysql_error());

     

            print("<select name='category' value=''>/n");

            while($rowArray=mysql_fetch_array($result))

            {

           print("<optionvalue='".$rowArray['category_id']."'>".$rowArray['categroy_name']."</ option>/n");

            }

            print("</select>");

    }

     

     

    【真题216】 使用PHP写一段简单查询,查出所有姓名为“张三”的内容并打印出来。

    表名User

    Name    Tel      Content      Date

    张三 13333663366 大专毕业 2006-10-11

    张三 13612312331 本科毕业 2006-10-15

    张四 021-55665566 中专毕业 2006-10-15

     

    参考答案:根据上面的题目完成代码:

    $mysql_db=mysql_connect("local","root","pass");

    @mysql_select_db("DB",$mysql_db);

     $result = mysql_query("SELECT * FROM 'user' WHERE name='张三'");

     while($rs = mysql_fetch_array($result)){

         echo $rs["tel"].$rs["content"].$rs["date"];

      }

     

     

    【真题217】 考虑如下SQL语句,哪个选项能对返回记录的条数进行限制?(    )(双选)

    SELECT * FROM MY_TABLE

     

    A.如果可能,那么把查询转换成存储例程

    B.如果程序允许,那么给查询指定返回记录的范围

    C.如果可能,那么添加 where 条件

    D.如果DBMS允许,那么把查询转换成视图

    参考答案:B、C。

    分析:有两个方法能限制返回记录的条数——使用 where 条件或limit关键字指定查询返回的记录的范围。

    通常情况下,如果没有特殊需要,那么尽量不要用 select *,这会浪费大量的数据缓存。

     

    【真题218】 执行以下 SQL 语句后将发生(    )。

    BEGIN TRANSACTION

    DELETE FROM MYTABLE WHERE ID=1

    DELETE FROM OTHERTABLE

    ROLLBACK TRANSACTION

     

    A.OTHERTABLE 中的内容将被删除

    B.OTHERTABLE 和 MYTABLE 中的内容都会被删除

    C.OTHERTABLE 中的内容将被删除,MYTABLE 中 ID 是 1 的内容将被删除

    D.数据库没有变化

    参考答案:D。

    分析:这个查询是一个事务,并且这个事务的最后有回滚,数据库不会有变化。

     

     

    Mysql题目

    一、如何进行数据库优化?

    数据库优化的过程可以使用以下的方法进行:

    1)选取最适用的字段属性,尽可能减少定义字段长度,尽量把字段设置NOT NULL,例如'省份、性别',最好设置为ENUM。

    2)使用连接(JOIN)来代替子查询。

    ① 删除没有任何订单客户:DELETE FROM customerinfo WHERE customerid NOT in(SELECT customerid FROM orderinfo)。

    ② 提取所有没有订单客户:SELECT FROM customerinfo WHERE customerid NOT in(SELECT customerid FROM orderinfo)。

    ③ 提高b的速度优化:SELECT FROM customerinfo LEFT JOIN orderid customerinfo. customerid=orderinfo.customerid WHERE orderinfo.customerid IS NULL。

    3)使用联合(UNION)来代替手动创建的临时表。创建临时表:SELECT name FROM 'nametest' UNION SELECT username FROM 'nametest2'。

    4)事务处理。保证数据完整性,例如添加和修改。同时,如果两者成立,则都执行,一者失败都失败:

    mysql_query("BEGIN");

    mysql_query("INSERT INTO customerinfo (name) VALUES ('$name1')";

    mysql_query("SELECT * FROM 'orderinfo' where customerid=".$id");

    mysql_query("COMMIT");

     

    5)锁定表,优化事务处理。用一个SELECT语句取出初始数据,通过一些计算,用UPDATE语句将新值更新到表中。包含有WRITE关键字的LOCK TABLE语句可以保证在UNLOCK TABLES命令被执行之前,不会有其他的访问来对customerinfo表进行插入、更新或者删除的操作。

    mysql_query("LOCK TABLE customerinfo READ, orderinfo WRITE");

    mysql_query("SELECT customerid FROM 'customerinfo' where id=".$id);

    mysql_query("UPDATE 'orderinfo' SET ordertitle='$title' where customerid=".$id);

    mysql_query("UNLOCK TABLES");

     

    6)使用外键,优化锁定表。把customerinfo里的customerid映射到orderinfo里的customerid,任何一条没有合法的customerid的记录不会写到orderinfo里。

     CREATE TABLE customerinfo

       (

         customerid INT NOT NULL,

         PRIMARY KEY(customerid)  

       )TYPE = INNODB;

       CREATE TABLE orderinfo

       (

         orderid INT NOT NULL,

         customerid INT NOT NULL,

         PRIMARY KEY(customerid,orderid),

         FOREIGN KEY (customerid) REFERENCES customerinfo

         (customerid) ON DELETE CASCADE   

       )TYPE = INNODB;

     

    注意:'ON DELETE CASCADE',该参数保证当customerinfo表中的一条记录删除的话同时也会删除order。

    表中的该用户的所有记录,注意使用外键时要定义数据库引擎为INNODB。

     

    • 选择正确的存储引擎?

    在MySQL中有两个存储引擎:MyISAM和InnoDB,每个引擎都有利有弊。

    MyISAM适合于一些需要大量查询的应用,但其对于有大量写操作的支持并不是很好。甚至只是需要update一个字段,整个表都会被锁起来,而其他进程,就算是读进程都无法操作直到读操作完成。另外,MyISAM 对于 SELECT COUNT(*) 这类的计算是超快无比的。

    InnoDB 的趋势会是一个非常复杂的存储引擎,对于一些小的应用,它会比 MyISAM 还慢。但是它支持“行锁”,于是在写操作比较多的时候,会更优秀。并且,它还支持更多的高级应用,例如事务。

     

    • 【真题231】 用什么方法检查PHP脚本的执行效率(通常是脚本执行时间)和数据库SQL的效率(通常是数据库query时间),并定位和分析脚本执行和数据库查询的瓶颈所在?

    参考答案:检查PHP脚本的执行效率的方法如下:可以在检查的代码开头记录一个时间,然后在代码的结尾也记录一个时间,结尾时间减去开头时间取这个时间的差值,从而检查PHP的脚本执行效率,记录时间可以使用microtime()函数。

    检查数据库SQL的效率的方法如下:可以通过explain显示MySQL如何使用索引来处理select语句及连接表,帮助选择更好的索引和写出更优化的查询语句。然后启用slow query log记录慢查询,通过查看SQL的执行时间和效率来定位分析脚本执行的问题和瓶颈所在。

     

    •  以下代码的运行结果为(    )。

    <?php

        mysql_connect('localhost','root',"");

        $result = mysql_query("SELECT id,name FROM tb1");

        while($row = mysql_fetch_array($result,MySQL_ASSOC)){

            echo' ID:' .$row[0].' Name:' .$row[];

        }

    ?>

     

    A.报错    B.循环换行打印全部记录      

    C.无任何结果 D.只打印第一条记录

    参考答案:A。

    分析:因为代码中没有指明要操作的数据库名,所以会报错。

    所以,本题的答案为A。

     

     

    【真题222】 以下说法正确的是(    )。

    A.使用索引能加快插入数据的速度

    B.良好的索引策略有助于防止跨站攻击

    C.应当根据数据库的实际应用合理设计索引

    D.删除一条记录将导致整个表的索引被破坏

    参考答案:C。

    分析:索引的作用主要是帮助数据库快速查找到对应的数据,并不能加快插入数据的速度,所以,选项A错误。

    索引不能够帮助防止跨站攻击,所以,选项B错误。

    创建合理的索引需要分析数据库的实际用途并找出它的弱点。优化脚本中的冗余查询同样也能提高数据库效率。索引是占用物理空间的,所以在实际的应用中是要合理设计使用索引的。所以,选项C正确。

    索引是一种表结构,删除一条数据也不会影响到整个表的索引,并且索引不一定是数字,也可以是字符串。所以,选项D错误。

     

    【真题223】 下列关于全文检索技术的说法中,不正确的是(    )。

    A.Sphinx是一个基于SQL的全文检索引擎,可以结合MySQL做全文搜索,它可以提供比数据库本身更专业的搜索功能

    B.Solr是新一代的全文检索组件,它比Lucene的搜索效率高很多,还能支持HTTP的访问方式,PHP调用Solr也很方便

    C.MySQL中把一个字段建立FULLTEXT索引,就可以实现全文检索,目前MyISAM和InnoDB的table都支持FULLTEXT索引

    D.Lucene附带的二元分词分析器CJKAnalyzer切词速度很快,能满足一般的全文检索需要

    参考答案:B。

    分析:Sphinx是一个基于SQL的全文检索引擎,可以结合MySQL、PostgreSQL做全文搜索,它可以提供比数据库本身更专业的搜索功能,使得应用程序更容易实现专业化的全文检索。

    Solr是一个独立的企业级搜索应用服务器,用户可以通过HTTP请求访问,它是采用JAVA5开发,基于Lucene的全文搜索服务器,同时对其进行了扩展,提供了比Lucene更为丰富的查询语言,同时实现了可配置、可扩展并对查询性能进行了优化,并且提供了一个完善的功能管理界面,是一款非常优秀的全文搜索引擎。并且Solr比Lucene的搜索效率高很多,但是PHP调用Solr并不方便,选项B的说法错误。

    MySQL中的MyISAM和InnoDB都是支持FULLTEXT全文索引的。全文搜索引擎可以在不使用模板匹配操作的情况下查找单词或短语。

     

    更多PHP面试笔试真题可以浏览:www.shuaiqi100.com  

    更多有趣有料的PHP面试笔试资料可以关注:“琉忆编程库”

    PHP程序员面试笔试宝典

    展开全文
  • 很荣幸能够在这里带来我的第一本新书——《PHP程序员面试笔试宝典》。 一、创作过程 《PHP程序员面试笔试宝典》是我的第一本书,从写作到出来总共经历了一整年的时间。它就像我的孩子一样,十分的努力去创作,也...

    你好,是我琉忆。

    一个文艺的PHP开发工程师。

    很荣幸能够在这里带来我的第一本新书——《PHP程序员面试笔试宝典》。

    一、创作过程

    《PHP程序员面试笔试宝典》是我的第一本书,从写作到出来总共经历了一整年的时间。它就像我的孩子一样,十分的努力去创作,也十分的爱惜,创作实际用了3个月的时间,但是在长达审稿修改的时间却也用了3个月,剩余的3个月时间是出版社几个编辑在帮我审稿修改,对里面的字句进行斟酌跟我讨论修改。在此对他们的付出抱以诚挚真诚的感谢,谢谢你们的付出。

    这本书是自己第一本出版的书,所以自己格外的爱惜它,也很怕这本书的内容不能满足大众,生怕被PHPer所嫌弃。在创作这本书的过程中,时常从读者的角度去审查它,它是否能够切实的在解答每道面试题上提供帮助,所涉及的知识点是否切实际的回答完善并且正确。并且我也知道自己的能力会有所欠缺,可能做得不够尽善尽美,但我也已经在此贡献了自己所能够达到最极致的能力去做好他。如果本书有所欠缺在此希望读者能够谅解,并可以对书中有所遗漏或不足之处给我写邮件进行指点,我将不断地对《PHP程序员面试笔试宝典》不断迭代完善,不断追求极致,帮助更多的PHPer面试成功。我的邮箱:330168885@qq.com(我的QQ:330168885),如果有什么事情也可以给我联系,我都愿意解答并且交流。感谢你,dear 读者。

    二、我的书籍简介

    本书主要针对 PHP 常考的知识点进行了梳理和整理,通过这些知识点,以点为面、全面系统地帮助读者发现自己的知识盲点,从而查漏补缺,帮助他们快速构建属于自己的 PHP 知识架构。由于这些知识点都是在笔试或面试的过程中经常遇到的,因此为了让读者能够更深入地理解这些相关的知识点,本书还在知识点的后面配上了相关的真题与解析,通过真题与解析加深读者的理解。

    编者花费了几个月的时间,对 PHP 的知识点和各大互联网公司应用的技术和面试的问题

    进行了深入了解。针对面试 PHP 岗位的常考考点,整理出这本《PHP 程序员面试笔试宝典》。

    三、章节介绍

    上篇:面试笔试经验技巧篇

    想找到一份程序员的工作,一点技术都没有显然是不行的,但是,只有技术也是不够的。面试笔试经验技巧篇主要提供PHP程序员面试笔试经验、面试笔试问题方法讨论等。通过本篇的学习,求职者必将获取到丰富的应试技巧与方法。

    下篇:面试笔试技术攻克篇

    面试笔试技术攻克篇主要针对近3年以来近百家顶级IT企业的面试笔试真题而设计,这些企业涉及面非常广泛,面试笔试真题难易适中,非常具有代表性与参考性。本篇对这些真题以及其背后的知识点进行了深度剖析,并且对部分真题进行了庖丁解牛式的分析与讲解,针对真题中涉及的部分重难点问题,本篇都进行了适当的扩展与延伸,力求对知识点的讲解清晰而不紊乱,全面而不啰嗦,使得读者能够通过本书不仅获取到求职的知识,同时更有针对性地进行求职准备,最终能够收获一份满意的工作。

    第1章 PHP基础知识

    PHP也称为超文本预处理器,是一种开源的服务端脚本语言。目前,在全球拥有的100万站点中,有70%左右的站点是使用PHP开发的,PHP被广泛地应用于各种服务端前端及应用的开发。在面试笔试中PHP基础知识经常被考到,通过基础知识可以了解一个PHP程序员的功底如何。如果连PHP基础都没能掌握的人,那么很难在笔试中胜出。所以熟练地掌握PHP基础知识显得非常重要。这一章节将详细地介绍所有可能考到的PHP基础知识。

    第2章PHP Web与框架

    因为PHP是内嵌在Web的脚本语言,所以PHP和Web是分不开的。而为了避免因为PHP与Web代码的高度混杂在一起导致阅读性和维护性问题而产生了框架,合理地分开了前后端开发人员的工作。由于web和框架都是PHP开发中必不可少的东西,所以在面试中也是重要考点,作为开发者是必须熟练掌握各种主流的MVC框架的,因为在实际开发中经常用到。

    第3章PHP进阶知识

    本章主要针对PHP的时间和日期管理、缓存、文件、验证码等部分进行讲解。在一个项目的实际开发中,都需要涉及这些知识,它会穿插在整个项目中。在面试中问得比较多的是时间和缓存相关的问题,只要是涉及数据的存储都需要和时间打交道,而缓存是为了提高网站的打开速度而一定要使用的技术。

    第4章 设计模式

    无论是PHP还是Java,都时常会考到设计模式,了解透设计模式的人可以很快知道在什么场景下采用哪种代码的设计是合理的、稳定的、可扩展的,这样可以帮助团队在设计的前期减少问题的产生。而熟练掌握面向对象开发的人不一定懂得设计模式,但懂得设计模式的人可以熟练懂得面向对象,所以通过设计模式可以看出一个人对面向对象的掌握熟练程度,并且懂得设计模式的人还可以开发出一套模板或框架。对PHP程序员来说,因为设计模式是非常重要的,所以在面试中经常考到。

    第5章 数据库

    数据库是按照数据结构来组织、存储和管理数据的仓库。从最简单的存储各种数据的表格数据到如今进行海量数据存储都要用到数据库。PHP主要负责客户端和数据库的交互,随着用户访问一个网站的量的增加,PHP每次请求一次数据库都需要耗费内存和访问时间,从而加大服务器的压力和降低网页的访问速度。所以如今的公司都要求每个PHP开发人员需要懂得数据库的合理设计、优化。高并发访问的网站对数据库的设计维护要求更高,需要引入Memcache或Redis缓存来减少对数据库的请求,从而提高用户的访问速度。本章详细介绍MySQL的知识、优化和常考题目。

    第6章 操 作 系 统

    对于计算机系统而言,操作系统充当着基石的作用,它是连接计算机底层硬件与上层应用软件的桥梁,控制其他程序的运行,并且管理系统相关资源,同时提供配套的系统软件支持。对于专业的程序员而言,掌握一定的操作系统知识必不可少,因为不管面对的是底层嵌入式开发,还是上层的云计算开发,都需要使用到一定的操作系统相关知识。所以,对操作系统相关知识的考查是程序员面试笔试必考项之一。

    第7章 网 络

    在20世纪80年代,计算机网络诞生,它能够将一台台独立的计算机互相连接,使得位于不同地理位置的计算机之间可以进行通信,实现信息传递和资源共享,形成一组规模大、功能强的计算机系统。不过,计算机要想在网络中正常通信,必须遵守相关网络协议的规则,常用的网络协议有TCP、UDP、IP和HTTP等。

    第8章 大数据

    计算机硬件的扩容确实可以极大地提高程序的处理速度,但考虑到其技术、成本等方面的因素,它并非一条放之四海而皆准的途径。而随着互联网技术的发展,云计算、物联网、移动通信技术的兴起,每时每刻,数以亿计的用户产生着数量巨大的信息,海量数据时代已经来临。由于通过对海量数据的挖掘能有效地揭示用户的行为模式,加深对用户需求的理解,提取用户的集体智慧,从而为研发人员决策提供依据,提升产品用户体验,进而占领市场,所以当前各大互联网公司都将研究重点放在了海量数据分析上,但是,只寄希望于硬件扩容是很难满足海量数据分析需要的,如何利用现有条件进行海量信息处理已经成为各大互联网公司亟待解决的问题。所以,海量信息处理正日益成为当前程序员笔试面试中一个新的亮点。

    四、宝典的目录

    《PHP 程序员面试笔试宝典》整本书涵盖的知识目录包括:面试经验技巧、PHP常考基础知识、PHP面向对象和设计模式的知识点、PHP进阶知识、数据库常考的MySQL的知识点、计算机网络相关的知识点,除此之外还额外增加了操作系统的常考知识,和常考的大数据知识点等。帮助每个PHP程序员面试更顺利。

    整本书的目录:

    上篇:面试笔试经验技巧篇

    经验技巧1 如何巧妙地回答面试官的问题······································································· 2

    经验技巧2 如何回答技术性的问题················································································· 3

    经验技巧3 如何回答非技术性问题················································································· 4

    经验技巧4 如何回答快速估算类问题·············································································· 5

    经验技巧5 如何回答算法设计问题················································································· 6

    经验技巧6 如何回答系统设计题···················································································· 8

    经验技巧7 如何解决求职中的时间冲突问题·································································· 11

    经验技巧8 如果面试问题曾经遇见过,是否要告知面试官·············································· 12

    经验技巧9 在被企业拒绝后是否可以再申请·································································· 12

    经验技巧10 如何应对自己不会回答的问题··································································· 13

    经验技巧11 如何应对面试官的“激将法”语言····························································· 13

    经验技巧12 如何处理与面试官持不同观点这个问题······················································ 14

    经验技巧13 什么是职场暗语······················································································· 14

    经验技巧14 如何进行自我介绍?················································································· 18

    经验技巧15 如何克服面试中紧张的情绪?··································································· 19

    经验技巧16 如何准备集体面试?················································································· 21

    经验技巧17 如何准备电话面试?················································································· 23

    经验技巧18 签约和违约需要注意哪些事情?································································ 24

    下篇:面试笔试技术攻克篇

    第1章 PHP基础知识································································································· 29

    1.1 PHP语言········································································································· 29

    1.1.1 PHP与ASP、JSP有什么区别?···································································· 29

    1.1.2 PHP与HTML有什么区别?········································································· 31

    1.1.3 PHP的优点是什么?··················································································· 32

    1.1.4 PHP的输出语句有哪些?············································································· 33

    1.1.5 如何区分单引号与双引号?·········································································· 35

    1.1.6 什么是XML?··························································································· 37

    1.2 面向对象技术··································································································· 40

    1.2.1 面向对象与面向过程有什么区别?································································· 40

    1.2.2 面向对象的特征是什么?············································································· 41

    1.2.3 面向对象的开发方式有什么优点?································································· 41

    1.2.4 类与对象的区别是什么?············································································· 41

    1.2.5 PHP5 中魔术方法有哪些?··········································································· 43

    1.2.6 值传递与引用传递有什么区别?···································································· 51

    1.2.7 什么是对象克隆?······················································································ 52

    1.2.8 什么是延迟静态绑定?················································································ 56

    1.2.9 作用域范围有哪几种?················································································ 57

    1.2.10 什么是构造函数?什么是析构函数?···························································· 58

    1.2.11 什么是继承?·························································································· 60

    1.2.12 抽象类与接口有什么区别与联系?································································ 63

    1.2.13 什么是多态?·························································································· 65

    1.3 关键字············································································································· 67

    1.3.1 final有什么作用?······················································································ 67

    1.3.2 finally有什么作用?··················································································· 68

    1.3.3 assert有什么作用?···················································································· 69

    1.3.4 static有什么作用?····················································································· 70

    1.3.5 global有什么作用?···················································································· 72

    1.3.6 this、self和parent的区别是什么?································································· 73

    1.3.7 include与require有什么区别?······································································ 75

    1.3.8 break、continue与return有什么区别与联系?··················································· 77

    1.3.9 switch有什么作用?··················································································· 79

    1.4 常量与变量······································································································ 81

    1.4.1 什么是常量?···························································································· 81

    1.4.2 什么是变量?···························································································· 84

    1.4.3 如何判断变量是否存在、是否为非空字符或非零?············································ 87

    1.4.4 变量的作用域范围有哪几种?······································································· 87

    1.4.5 如何对变量进行引用?················································································ 89

    1.5 数据类型········································································································· 90

    1.5.1 基本数据类型有哪些?················································································ 90

    1.5.2 如何进行类型转换?··················································································· 92

    1.6 运算符············································································································· 93

    1.6.1 运算符的种类有哪些?················································································ 93

    1.6.2 ++与—的含义是什么?·············································································· 100

    1.7 字符串··········································································································· 101

    1.7.1 字符串处理函数有哪些?··········································································· 101

    1.7.2 ==与===有什么区别?··············································································· 106

    1.8 正则表达式···································································································· 106

    1.9 函数·············································································································· 111

    1.9.1 传值和引用的区别是什么?········································································ 111

    1.9.2 什么是默认参数?···················································································· 114

    1.9.3 什么是函数返回值?················································································· 114

    1.9.4 如何进行函数调用?················································································· 115

    1.10 数组············································································································ 117

    1.10.1 如何进行数组的定义与声明?···································································· 117

    1.10.2 什么是多维数组?··················································································· 121

    1.10.3 数组函数有哪些?··················································································· 124

    1.11 文件管理······································································································ 130

    1.11.1 有哪些文件操作?···················································································· 130

    1.11.2 涉及文件操作的函数有哪些?···································································· 134

    1.12 异常处理与错误处理····················································································· 137

    1.12.1 什么是异常处理与错误处理?···································································· 137

    1.12.2 error_reporting()的作用是什么?································································· 138

    1.12.3 如何进行异常捕捉与处理?······································································· 139

    1.12.4 如何实现自定义的异常类?······································································· 141

    1.13 内存管理······································································································ 141

    1.13.1 什么是内存管理?··················································································· 141

    1.13.2 什么是垃圾回收?··················································································· 142

    1.14 Redis············································································································ 143

    1.14.1 什么是Redis?······················································································· 143

    1.14.2 Redis的常见问题有哪些?········································································ 145

    1.15 Memcache····································································································· 147

    第2章 PHP Web与框架··························································································· 153

    2.1 PHP Web········································································································ 153

    2.1.1 Session与Cookie的区别是什么?································································ 153

    2.1.2 GET和POST有什么区别?········································································ 158

    2.1.3 如何预防各类安全性问题?········································································ 160

    2.1.4 HTTP状态码的含义是什么?······································································ 161

    2.1.5 utf-8编码需要注意哪些问题?····································································· 164

    2.1.6 如何进行网站的优化?·············································································· 165

    2.2 模板·············································································································· 166

    2.3 框架·············································································································· 167

    2.3.1 什么是MVC?························································································· 167

    2.3.2 PHP的开发框架有哪些?··········································································· 168

    2.3.3 什么是CI框架?······················································································ 168

    2.4 JavaScript、HTML、CSS等············································································· 171

    第3章 PHP进阶知识······························································································· 173

    3.1 时间和日期管理······························································································ 173

    3.1.1 如何输出年-月-日?················································································· 173

    3.1.2 如何输出时-分-秒?················································································· 174

    3.1.3 如何输出闰年-星期-天?··········································································· 175

    3.1.4 PHP相关的日期函数有哪些?····································································· 176

    3.2 缓存·············································································································· 179

    3.3 文件管理········································································································ 180

    3.3.1 PHP中文件操作函数有哪些?····································································· 180

    3.3.2 如何进行文件上传?················································································· 183

    3.3.3 如何进行文件下载?················································································· 185

    3.3.4 如何进行版本管理?················································································· 186

    3.4 验证码··········································································································· 187

    第4章 设计模式········································································································· 188

    4.1 常见的设计模式有哪些?················································································ 188

    4.2 什么是单例模式?·························································································· 190

    4.3 什么是工厂模式?·························································································· 191

    4.4 什么是观察者模式?······················································································· 192

    第5章 数据库············································································································ 196

    5.1 数据库基础知识······························································································ 196

    5.1.1 SQL语言的功能有哪些?··········································································· 197

    5.1.2 内连接与外连接有什么区别?····································································· 199

    5.1.3 什么是事务?·························································································· 200

    5.1.4 什么是存储过程?它与函数有什么区别与联系?·············································· 202

    5.1.5 一二三四范式有何区别?··········································································· 202

    5.1.6 什么是触发器?······················································································· 204

    5.1.7 什么是游标?·························································································· 205

    5.1.8 如果数据库日志满了,那么会出现什么情况?················································· 206

    5.1.9 UNION和UNION ALL有什么区别?··························································· 206

    5.1.10 什么是视图?························································································· 207

    5.1.11 什么是数据库三级封锁协议?···································································· 207

    5.1.12 索引的优缺点························································································· 208

    5.2 MySQL基础知识···························································································· 209

    5.2.1 PHP操作MySQL的函数有哪些?································································ 210

    5.2.2 PHP连接MySQL的方法是什么?································································ 211

    5.2.3 MySQLi访问数据库的方法········································································· 214

    5.2.4 如何进行MySQL操作?············································································ 218

    5.2.5 MySQL支持哪些字段类型?······································································· 227

    5.2.6 什么是索引?·························································································· 230

    5.2.7 什么是数据库引擎?················································································· 232

    5.2.8 如何进行数据库分页?·············································································· 233

    5.2.9 什么是数据库权限?················································································· 237

    5.2.10 PHP Web访问MySQL方法是什么?··························································· 238

    5.2.11 如何高效操作MySQL?··········································································· 240

    5.3 MySQL高级管理···························································································· 240

    5.3.1 如何对MySQL进行优化?········································································· 240

    5.3.2 如何进行数据库优化?·············································································· 244

    5.3.3 如何进行数据库操作优化?········································································ 247

    5.3.4 如何进行数据库表优化?··········································································· 249

    第6章 操作系统······································································································· 255

    6.1 进程管理········································································································ 255

    6.1.1 进程与线程有什么区别?··········································································· 255

    6.1.2 线程同步有哪些机制?·············································································· 256

    6.1.3 内核线程和用户线程的区别········································································ 256

    6.2 内存管理········································································································ 257

    6.2.1 内存管理有哪几种方式?··········································································· 257

    6.2.2 什么是虚拟内存?···················································································· 258

    6.2.3 什么是内存碎片?什么是内碎片?什么是外碎片?··········································· 258

    6.2.4 虚拟地址、逻辑地址、线性地址、物理地址有什么区别?·································· 259

    6.2.5 Cache替换算法有哪些?············································································ 259

    6.3 用户编程接口································································································· 261

    6.3.1 库函数调用与系统调用有什么不同?····························································· 261

    6.3.2 静态链接与动态链接有什么区别?······························································· 261

    6.3.3 静态链接库与动态链接库有什么区别?·························································· 262

    6.3.4 用户态和核心态有什么区别?····································································· 262

    6.3.5 用户栈与内核栈有什么区别?····································································· 263

    第7章 网络·············································································································· 264

    7.1 TCP/IP··········································································································· 264

    7.1.1 协议······································································································ 264

    7.1.2 TCP/IP··································································································· 265

    7.1.3 常见笔试题····························································································· 265

    7.2 RESTful架构风格··························································································· 266

    7.2.1 REST····································································································· 266

    7.2.2 约束条件································································································ 267

    7.2.3 常见笔试题····························································································· 267

    7.3 HTTP············································································································ 268

    7.3.1 URI和URL···························································································· 268

    7.3.2 HTTP协议······························································································ 269

    7.3.3 HTTP报文······························································································ 271

    7.3.4 HTTP首部······························································································ 272

    7.3.5 缓存······································································································ 273

    7.3.6 常见笔试题····························································································· 275

    7.4 TCP··············································································································· 276

    7.4.1 连接管理································································································ 276

    7.4.2 确认应答································································································ 278

    7.4.3 窗口控制································································································ 280

    7.4.4 重传控制································································································ 281

    7.4.5 常见笔试题····························································································· 281

    7.5 HTTPS··········································································································· 282

    7.5.1 加密······································································································ 283

    7.5.2 数字签名································································································ 283

    7.5.3 数字证书································································································ 284

    7.5.4 安全通信机制·························································································· 284

    7.5.5 常见笔试题····························································································· 286

    7.6 HTTP/2.0······································································································· 286

    7.6.1 二进制分帧层·························································································· 287

    7.6.2 多路通信································································································ 288

    7.6.3 请求优先级····························································································· 288

    7.6.4 服务器推送····························································································· 289

    7.6.5 首部压缩································································································ 289

    7.6.6 常见笔试题····························································································· 289

    第8章 大数据·········································································································· 290

    8.1 从大量的URL中找出相同的URL···································································· 290

    8.2 求高频词········································································································ 290

    8.3 找出访问百度最多的IP··················································································· 291

    8.4 在大量的数据中找出不重复的整数··································································· 292

    8.5 在大量的数据中判断一个数是否存在································································ 292

    8.6 如何查询最热门的查询串················································································ 293

    8.7 统计不同电话号码的个数················································································ 294

    8.8 从5亿个数中找出中位数················································································ 295

    8.9 按照query的频度排序···················································································· 296

    8.10 找出排名前500的数····················································································· 297

    附录 真题及答案······································································································· 298

    真题1··················································································································· 298

    真题2··················································································································· 300

    真题3··················································································································· 303

    真题1答案············································································································ 305

    真题2答案············································································································ 306

    真题3答案············································································································ 308

    五、由衷的感谢

    作者本名刘恒春,笔名琉忆,在这里最先感谢的是大神何昊和薛鹏给予的这个机会,让我有机会参与PHP相关的面试书籍的创作,其次感谢机械工业出版社给予的出版机会。最后由衷的感谢支持我的父母、哥哥姐姐,还有我的朋友,是你们的支持才让我最终得以完成这本书。还有为了这本宝典默默付出审稿的幕后工作者们,非常感谢你们,你们辛苦了。

    在此对以上帮助过我得以出版PHP面试宝典的人说声谢谢,非常感谢。

     

    最后由衷的感谢每一位读者,谢谢你们对本书的支持。

    展开全文
  • PHP开发实战宝典pdf

    2018-08-21 10:48:03
    链接:https://pan.baidu.com/s/1pf5DXWJpNZvkMrnAVOOJ3A 密码:n0y3 本书为完整版,以下为内容截图:  
    链接:https://pan.baidu.com/s/1pf5DXWJpNZvkMrnAVOOJ3A 密码:n0y3

    本书为完整版,以下为内容截图:

     

    展开全文
  • php开发宝典 资料全

    2019-05-20 11:05:17
    链接: https://pan.baidu.com/s/1RO050k4SDvDquPFigWbwTA 提取码: dgry 复制这段内容后打开百度网盘手机App,操作更方便哦

    链接: https://pan.baidu.com/s/1RO050k4SDvDquPFigWbwTA 提取码: dgry 复制这段内容后打开百度网盘手机App,操作更方便哦

    展开全文
  • 精创之作《雷神的微软平台安全宝典》诚邀译者

    万次阅读 热门讨论 2012-06-12 10:18:57
    《雷神的微软平台安全宝典》雷与不雷?雷神精创之作就在这里。CSDN博客频道携手清华大学出版社诚邀天才的你,翻译本书。 一、活动时间 2012年5月14日至2012年6月3日 二、活动规则 您可以以下面任何一...
  • [本人baidu博客全部搬家到csdn,baidu博客地址:http://hi.baidu.com/new/miracleconf] [添翼圈独家出品]MOTO XT301 精彩广告兼功能介绍 ... 玩转android系统智能3G手机动画教学片——以XT800为例 ...
  • 按键精灵 使用教程

    万次阅读 2018-07-25 11:29:01
    按键精灵官网:http://www.anjian.com/ 资源站:http://zy.anjian.com/ ... 按键宝典 - 知识库:http://zy.anjian.com/index.php?action-viewnews-itemid-161 截图 处理图片技巧:http://www.360doc....
  • 我所知道的面试手册

    千次阅读 2019-03-03 21:53:41
    传智播客总结的面试宝典,里面有 Android、C++、Java、PHP、大数据五种。 CSDN 下载 数据结构与算法/leetcode/lintcode题解 本文档为数据结构和算法学习笔记,全文大致分为以下三大部分: Part I...
  • .NET开发人员必备电子书下载

    千次阅读 2012-08-21 10:25:44
    http://pan.baidu.com/share/link?shareid=4581&uk=2870586885 正则表达式,网页配色,设计模式,XML手册,XMLHTTP手册,SQL参考手册,CSS手册,CSS滤镜手册, ADO手册,DHTML手册,DHTML行为手册,DOM文档对象...
  • 程序员面试宝典

    千次阅读 2016-04-02 22:20:50
    初次接触编程是在上大学,从C语言的hello world学起,再到后面的C++,JAVA,数据库,计算机网络,WEB开发,汇编,软件工程,编译原理,操作系统,嵌入式编程等等,每学期流水账似的数十门课程,每一门其实都蛮重要的...
  • 传智播客PHP面试题宝典开放下载

    千次阅读 2013-08-07 15:36:03
    上下卷面试题更新完毕,一部让菜鸟4k+入职的面试题宝典
  • Kindle pdf电子书 Java程序员面试宝典

    千次阅读 2015-05-19 22:06:19
    适合应届生面试用,因为缺乏项目经验。 夯实一下基础。 临时抱抱佛教也可以。PDF清晰文字版 http://www.rcdisk.com/index.php/group/topic/id-62
  • struts2标签库

    千次阅读 2009-12-29 10:54:00
    struts2标签库 文本框输入文字 struts2标签是struts2的重点,和action配合使用,就是struts2的重点。第一次使用struts2,就觉得比 jsp/servlet这样的方案,容易多了。 在jsp放个input之类的文本框,在servlet中用...
  • iScroll4插件的使用实例

    万次阅读 2013-08-06 13:34:17
    iScroll是Matteo Spinelli开发的一个滚动插件,使用原生js编写,其不依赖与任何js框架。iScroll 4 完全重写了iScroll这个框架的原始代码。旨在解决移动webkit系浏览器的区域滚动问题,兼容mobile safari、android...
  •  2013年5月,CNIT-Research (中国IT研究中心)对高德地图、百度地图、谷歌地图、四维图新、超图、SOSO街景地图、图吧地图、搜狗地图、老虎宝典、悠悠手机导航、凯立德导航、导航犬等12家地图软件的网络品牌影响力...
  • PHP面试技巧分享,PHP面试题,PHP宝典尽在“琉忆编程库”。 自我介绍是面试中至关重要的一个步骤,很多面试官对求职者提出的第一个问题往往就是“能否请您先自我介绍一下”,有时候求职者会对此很困惑,个人情况在...
  • 求职有用网站及QQ群一览表
  • 本文摘自《PHP程序员面试笔试宝典》 在面试的过程中,对面试官提出的问题求职者并不是都能回答出来,计算机技术博大精深,很少有人能对计算机技术的各个分支学科了如指掌。而且抛开技术层面的问题,在面试那种紧张...
  • 2019最新java面试葵花宝典

    万次阅读 多人点赞 2019-03-12 12:43:25
    15年毕业到现在也近四年了,最近面试了阿里集团(菜鸟网络,蚂蚁金服),网易,滴滴,点我达,最终收到点我达,网易offer,蚂蚁金服二面挂掉,菜鸟网络一个月了还在流程中,最终有幸去了网易。 ...
  • Windows下FFmpeg快速入门

    万次阅读 2009-07-29 16:36:00
    本系列文章导航Windows下FFmpeg快速入门ffmpeg参数解释mencoder和ffmpeg参数详解(Java处理视频)Java 生成视频缩略图(ffmpeg)使用ffmpeg进行视频文件转换成FLV整理java 视频处理 mencoderjava 视频处理 ffmped+...
1 2 3 4 5 ... 20
收藏数 5,130
精华内容 2,052
关键字:

php宝典