Home  >  Article  >  Backend Development  >  PHP工程师的面试题【部分解答】

PHP工程师的面试题【部分解答】

WBOY
WBOYOriginal
2016-06-13 12:56:18763browse

PHP高级工程师的面试题【部分解答】

  作者:zhanhailiang 日期:2013-01-16

问题集来源《整理了一份招PHP高级工程师的面试题》.

1. 基本知识点

问题: HTTP协议中几个状态码的含义: 503 500 401 200 301 302.
  • 503 Service Unavailable 由于临时的服务器维护或者过载, 服务器当前无法处理请求, 这个状况是临时的, 并且将在一段时间以后恢复
  • 500 SERVER ERROR 服务器端出错
  • 401.1 Logon failed(登录失败)
  • 401.2 Logon failed due to server configuration(由于服务器配置,登录失败)
  • 401.3 Unauthorized due to ACL on resource(由于资源上的ACL, 未授权)
  • 401.4 Authorization failed by filter(由于筛选器, 授权失败)
  • 401.5 Authorization failed by ISAPI/CGI application (由于 ISAPI/CGI 应用程序, 授权失败)
  • 200 OK
  • 301 页面永久性跳转 一般出现更新域名
  • 302 页面临时性跳转

    总结:

    • 2XX 成功
    • 3XX 重定向
    • 4XX 客户端出错
    • 5XX 服务器端出错
      问题: include, require, include_once, require_once的区别.

      1).include()产生一个警告而require()则导致一个致命错误. 换句话说, 如果想在遇到丢失文件时停止处理页面就用 require().include()就不是这样, 脚本会继续运行. 同时也要确认设置了合适的include_path. 注意在PHP 4.3.5之前, 包含文件中的语法错误不会导致程序停止, 但从此版本之后会.

      2).include_once()语句在脚本执行期间包含并运行指定文件. 此行为和include()语句类似, 唯一区别是如果该文件中的代码已经被包含了, 则不会再次包含. 如同此语句名字暗示的那样, 只会包含一次. include_once()应该用于在脚本执行期间同一个文件有可能被包含超过一次的情况下, 想确保它只被包含一次以避免函数重定义, 变量重新赋值等问题. 返回值和include()相同.如果文件已被包含, 本函数返回TRUE.

      问题: PHP/Mysql中几个版本的进化史, 比如mysql4.0到4.1, PHP 4.x到5.1的重大改进等等.
      问题: HEREDOC介绍

      1).第三种定义字符串的方法是用heredoc句法结构:

      <span class="kw2" style="color:rgb(0,0,0); font-weight:bold"><?php</span>
      <span class="re0" style="color:rgb(0,0,255)">$str</span> <span class="sy0" style="color:rgb(102,204,102)">=</span> <span class="co3" style="color:rgb(128,128,128)"><<<EOD
      Example of string
      spanning multiple lines
      using heredoc syntax.
      EOD</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
      <span class="sy1">?></span>

      在该提示符后面, 要定义个标识符, 然后是一个新行. 接下来是字符串 本身, 最后要用前面定义的标识符作为结束标志. 结束时所引用的标识符必须在一行的开始位置, 而且, 标识符的命名也要像其它标签一样遵守PHP的规则: 只能包含字母、数字和下划线, 并且不能用数字和下划线作为开头.

      2).Heredoc结构就象是没有使用双引号的双引号字符串, 这就是说在heredoc结构中引号不用被替换, 但是上文中列出的字符 (\n等)也可使用. 变量将被替换, 但在heredoc结构中字符串表达复杂变量时, 要格外小心.

      3).在PHP 5.3.0中还在Heredoc结构中用双引号来声明标志符

      <span class="kw2" style="color:rgb(0,0,0); font-weight:bold"><?php</span>
      <span class="kw1" style="color:rgb(177,177,0)">echo</span> <span class="sy0" style="color:rgb(102,204,102)"><<<</span><span class="st0" style="color:rgb(255,0,0)">"FOOBAR"</span>
      Hello World<span class="sy0" style="color:rgb(102,204,102)">!</span>
      FOOBAR<span class="sy0" style="color:rgb(102,204,102)">;</span>
      <span class="sy1">?></span> 
      问题: 写出一些php魔术方法.

      1).魔术方法:

      __construct(), 
      __destruct(), 
      __call(), 
      __callStatic(), 
      __get(), 
      __set(), 
      __isset(), 
      __unset(), 
      __sleep(), 
      __wakeup(), 
      __toString(), 
      __invoke(), 
      __set_state(),
      __clone()

      2).魔术变量:

      __LINE__, 
      __FILE__, 
      __DIR__, 
      __FUNCTION__, 
      __CLASS__, 
      __METHOD__, 
      __NAMESPACE__
      问题: 一些编译php时的configure参数.

      以我的编译参数为例:

      zhanhailiang<span class="sy0" style="color:rgb(102,204,102)">@</span>linux-06bq:~<span class="sy0" style="color:rgb(102,204,102)">></span> php <span class="re5">-ini</span><span class="sy0" style="color:rgb(102,204,102)">|</span><span class="kw2" style="color:rgb(0,0,0); font-weight:bold">grep</span> configure
      Configure Command =<span class="sy0" style="color:rgb(102,204,102)">></span>  <span class="st_h">'./configure'</span>  
      <span class="st_h">'--prefix=/usr/local/services/php'</span> 
      <span class="st_h">'--enable-fpm'</span> 
      <span class="st_h">'--with-config-file-path=/usr/local/services/php/etc'</span> 
      <span class="st_h">'--with-mysqli=/usr/local/services/mysql/bin/mysql_config'</span> 
      <span class="st_h">'--with-mysql=/usr/local/services/mysql'</span> 
      <span class="st_h">'--enable-mbstring'</span> 
      <span class="st_h">'--disable-mbregex'</span> 
      <span class="st_h">'--enable-sockets'</span> 
      <span class="st_h">'--disable-phar'</span> 
      <span class="st_h">'--with-mcrypt'</span> 
      <span class="st_h">'--with-gd'</span> 
      <span class="st_h">'--with-jpeg-dir=/usr/local'</span> 
      <span class="st_h">'--with-freetype-dir'</span> 
      <span class="st_h">'--with-curlwrappers'</span> 
      <span class="st_h">'--with-curl=/usr/local/services/curl'</span> 
      <span class="st_h">'--enable-soap'</span> 
      <span class="st_h">'--with-oci8=instantclient,/usr/local/services/oracle11g'</span> 
      <span class="st_h">'--with-zlib'</span> 
      <span class="st_h">'--with-openssl=/usr/local/ssl'</span> 
      <span class="st_h">'--with-xsl=/usr/local/'</span> 
      <span class="st_h">'--with-tidy=/usr/local/'</span> 
      <span class="st_h">'--with-pdo-mysql=/usr/local/services/mysql'</span> 
      <span class="st_h">'--enable-pcntl'</span>
      问题: 向php传入参数的两种方法. 

      1).PHP 的命令行模式

      2).

      zhanhailiang<span class="sy0" style="color:rgb(102,204,102)">@</span>linux-06bq:~<span class="sy0" style="color:rgb(102,204,102)">></span> php <span class="re5">-h</span><span class="sy0" style="color:rgb(102,204,102)">|</span><span class="kw2" style="color:rgb(0,0,0); font-weight:bold">grep</span> <span class="st0" style="color:rgb(255,0,0)">"args..."</span>
      Usage: php <span class="br0" style="color:rgb(102,204,102)">[</span>options<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>-f<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="sy0" style="color:rgb(102,204,102)"><</span><span class="kw2" style="color:rgb(0,0,0); font-weight:bold">file</span><span class="sy0" style="color:rgb(102,204,102)">></span> <span class="br0" style="color:rgb(102,204,102)">[</span>--<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>args...<span class="br0" style="color:rgb(102,204,102)">]</span>
             php <span class="br0" style="color:rgb(102,204,102)">[</span>options<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="re5">-r</span> <span class="sy0" style="color:rgb(102,204,102)"><</span>code<span class="sy0" style="color:rgb(102,204,102)">></span> <span class="br0" style="color:rgb(102,204,102)">[</span>--<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>args...<span class="br0" style="color:rgb(102,204,102)">]</span>
             php <span class="br0" style="color:rgb(102,204,102)">[</span>options<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>-B <span class="sy0" style="color:rgb(102,204,102)"><</span>begin_code<span class="sy0" style="color:rgb(102,204,102)">></span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="re5">-R</span> <span class="sy0" style="color:rgb(102,204,102)"><</span>code<span class="sy0" style="color:rgb(102,204,102)">></span> <span class="br0" style="color:rgb(102,204,102)">[</span>-E <span class="sy0" style="color:rgb(102,204,102)"><</span>end_code<span class="sy0" style="color:rgb(102,204,102)">></span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>--<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>args...<span class="br0" style="color:rgb(102,204,102)">]</span>
             php <span class="br0" style="color:rgb(102,204,102)">[</span>options<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>-B <span class="sy0" style="color:rgb(102,204,102)"><</span>begin_code<span class="sy0" style="color:rgb(102,204,102)">></span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="re5">-F</span> <span class="sy0" style="color:rgb(102,204,102)"><</span><span class="kw2" style="color:rgb(0,0,0); font-weight:bold">file</span><span class="sy0" style="color:rgb(102,204,102)">></span> <span class="br0" style="color:rgb(102,204,102)">[</span>-E <span class="sy0" style="color:rgb(102,204,102)"><</span>end_code<span class="sy0" style="color:rgb(102,204,102)">></span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>--<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="br0" style="color:rgb(102,204,102)">[</span>args...<span class="br0" style="color:rgb(102,204,102)">]</span>
             php <span class="br0" style="color:rgb(102,204,102)">[</span>options<span class="br0" style="color:rgb(102,204,102)">]</span> <span class="re5">--</span> <span class="br0" style="color:rgb(102,204,102)">[</span>args...<span class="br0" style="color:rgb(102,204,102)">]</span>
        args...          Arguments passed to script. Use <span class="re5">--</span> args when first argument
      问题: (mysql)请写出数据类型(INT CHAR VARCHAR DATETIME TEXT)的意思; 请问VARCHAR和CHAR有什么区别.

      1).INT在MySQL中支持的5个主要整数类型是TINYINT, SMALLINT, MEDIUMINT, INT和BIGINT. 这些类型在很大程度上是相同的, 只有它们存储的值的大小是不相同的. (其它略.)

      2).CHAR和VARCHAR类型

        CHAR类型用于定长字符串, 并且必须在圆括号内用一个大小修饰符来定义. 这个大小修饰符的范围从0-255. 比指定长度大的值将被截短, 而比指定长度小的值将会用空格作填补. CHAR类型可以使用BINARY修饰符. 当用于比较运算时, 这个修饰符使CHAR以二进制方式参于运算, 而不是以传统的区分大小写的方式.

        CHAR类型的一个变体是VARCHAR类型. 它是一种可变长度的字符串类型, 并且也必须带有一个范围在0-255之间的指示器. CHAR和VARCHGAR不同之处在于MySQL数据库处理这个指示器的方式: CHAR把这个大小视为值的大小, 不长度不足的情况下就用空格补足. 而VARCHAR类型把它视为最大值并且只使用存储字符串实际需要的长度(增加一个额外字节来存储字符串本身的长度)来存储值. 所以短于指示器长度的VARCHAR类型不会被空格填补, 但长于指示器的值仍然会被截短. 因为 VARCHAR 类型可以根据实际内容动态改变存储值的长度, 所以在不能确定字段需要多少字符时使用 VARCHAR 类型可以大大地节约磁盘空间、提高存储效率. VARCHAR 类型在使用 BINARY 修饰符时与 CHAR 类型完全相同.

      问题: error_reporting 等调试函数使用.

      以官方文档为便

      <span class="kw2" style="color:rgb(0,0,0); font-weight:bold"><?php</span>
       
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// Turn off all error reporting</span>
      <span class="kw3" style="color:rgb(0,0,102)">error_reporting</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">0</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
       
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// Report simple running errors</span>
      <span class="kw3" style="color:rgb(0,0,102)">error_reporting</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw4" style="color:rgb(153,51,51)">E_ERROR</span> <span class="sy0" style="color:rgb(102,204,102)">|</span> <span class="kw4" style="color:rgb(153,51,51)">E_WARNING</span> <span class="sy0" style="color:rgb(102,204,102)">|</span> <span class="kw4" style="color:rgb(153,51,51)">E_PARSE</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
       
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// Reporting E_NOTICE can be good too (to report uninitialized</span>
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// variables or catch variable name misspellings ...)</span>
      <span class="kw3" style="color:rgb(0,0,102)">error_reporting</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw4" style="color:rgb(153,51,51)">E_ERROR</span> <span class="sy0" style="color:rgb(102,204,102)">|</span> <span class="kw4" style="color:rgb(153,51,51)">E_WARNING</span> <span class="sy0" style="color:rgb(102,204,102)">|</span> <span class="kw4" style="color:rgb(153,51,51)">E_PARSE</span> <span class="sy0" style="color:rgb(102,204,102)">|</span> <span class="kw4" style="color:rgb(153,51,51)">E_NOTICE</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
       
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// Report all errors except E_NOTICE</span>
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// This is the default value set in php.ini</span>
      <span class="kw3" style="color:rgb(0,0,102)">error_reporting</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw4" style="color:rgb(153,51,51)">E_ALL</span> ^ <span class="kw4" style="color:rgb(153,51,51)">E_NOTICE</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
       
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// Report all PHP errors (see changelog)</span>
      <span class="kw3" style="color:rgb(0,0,102)">error_reporting</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw4" style="color:rgb(153,51,51)">E_ALL</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
       
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// Report all PHP errors</span>
      <span class="kw3" style="color:rgb(0,0,102)">error_reporting</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="sy0" style="color:rgb(102,204,102)">-</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
       
      <span class="co1" style="color:rgb(128,128,128); font-style:italic">// Same as error_reporting(E_ALL);</span>
      <span class="kw3" style="color:rgb(0,0,102)">ini_set</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="st_h">'error_reporting'</span><span class="sy0" style="color:rgb(102,204,102)">,</span> <span class="kw4" style="color:rgb(153,51,51)">E_ALL</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
       
      <span class="sy1">?></span> 
      问题: 您是否用过版本控制软件? 如果有您用的版本控制软件的名字是?

      SVN,Git

      问题: POSIX和PERL标准的正则表达式区别.

      《posix和perl标准的正则表达式区别》

      问题: safe_mode打开后哪些地方受限.

      《安全模式》

      问题: 写代码来解决多进程/线程同时读写一个文件的问题. 
      问题: 写一段上传文件的代码.

      《文件上传处理》

      问题: Mysql的存储引擎myisam和innodb的区别. 

      《InnoDB和MyISAM区别》

      2. web架构, 安全,项目经验

      问题: 介绍xdebug,apc,eAccelerator,Xcache,Zend opt的使用经验. 

      APC: 《php安装加速扩展APC详解》

      问题: 使用mod_rewrite在服务器上没有/archivers/567.html这个物理文件时, 重定向到index.php?id=567,请先打开mod_rewrite.

      rewrite ^/archivers/(\d+)\.html$ /index.php?id=$1;

      问题: MySQL数据库作发布系统的存储, 一天五万条以上的增量, 预计运维三年,怎么优化?
      问题: 写出一种排序算法(原理), 并说出优化它的方法. 

      【算法】快速排序【JS实现】 【算法】随机化快速排序【JS实现】

      问题: 请简单阐述您最得意的开发之作.
      问题: 对于大流量的网站,您采用什么样的方法来解决各页面访问量统计问题.
      问题: 您是否用过模板引擎? 如果有您用的模板引擎的名字是?

      Smarty

      问题: 请介绍Session的原理,大型网站中Session方面应注意什么?

      《session》

      问题: 测试php性能和mysql数据库性能的工具,和找出瓶颈的方法. 
      问题: 正则提出一个网页中的所有链接.
      <span class="kw2" style="color:rgb(0,0,0); font-weight:bold"><?php</span><span style="color:#333333">
       
      </span><span class="re0" style="color:rgb(0,0,255)">$a</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> </span><span class="st_h" style="color:rgb(51,51,51)">'<a href="test.html" title="#">test</a><a href="test.html" title="#">test</a>'</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">
      </span><span class="kw3" style="color:rgb(0,0,102)">preg_match_all</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="st_h"><span style="color:#333333">'|<a[^>]&#43;href="([^\"]*)".*</span><span style="color:#ff0000"><strong>?'.'></strong></span><span style="color:#333333">|'</span></span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="re0" style="color:rgb(0,0,255)">$a</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="re0" style="color:rgb(0,0,255)">$b</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">
      </span><span class="kw3" style="color:rgb(0,0,102)">print_r</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="re0" style="color:rgb(0,0,255)">$b</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
      问题: 介绍一下常见的SSO(单点登陆)方案(比如dedecms整合discuz的passport)的原理. 

      《单点登陆的技术实现机制分析》

      问题: 您写过的PHP框架的特点, 主要解决什么问题, 与其他框架的不同点. 
      问题: 大型的论坛/新闻文章系统/SNS网站在性能优化上有什么区别?
      问题: 相册类应用:要求在浏览器中能同时选中并上传多个文件, 图片要求能剪裁, 压缩包在服务器端解压. 能上传单个达50M的文件. 
      上传过程中有进度条显示. 每个图片能生成四种大小缩略图, 视频文件要转成flv供flash播放. 叙述要涉及的各类开源软
      件和简单用途. 
      问题: 一群猴子排成一圈, 按1, 2, …, n依次编号. 然后从第1只开始数, 数到第m只,把它踢出圈, 从它后面再开始数, 再数到
      第m只, 在把它踢出去…, 如此不停的进行下去, 直到最后只剩下一只猴子为止, 那只猴子就叫做大王. 要求编程模拟此过程, 输
      入m、n, 输出最后那个大王的编号. 用程序模拟该过程. 

      3. unix/linux 基本使用

      问题: linux下查看当前系统负载信息的一些方法.
      zhanhailiang<span class="sy0" style="color:rgb(102,204,102)">@</span>linux-06bq:<span class="sy0" style="color:rgb(102,204,102)">/</span>usr<span class="sy0" style="color:rgb(102,204,102)">/</span>local<span class="sy0" style="color:rgb(102,204,102)">/</span>services<span class="sy0" style="color:rgb(102,204,102)">/</span>php<span class="sy0" style="color:rgb(102,204,102)">/</span>sbin<span class="sy0" style="color:rgb(102,204,102)">></span> <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">uptime</span> 
        <span class="nu0" style="color:rgb(204,102,204)">5</span>:06pm  up <span class="nu0" style="color:rgb(204,102,204)">12</span> days  <span class="nu0" style="color:rgb(204,102,204)">8</span>:<span class="nu0" style="color:rgb(204,102,204)">12</span>,  <span class="nu0" style="color:rgb(204,102,204)">12</span> 个用户,平均负载:<span class="nu0" style="color:rgb(204,102,204)">0.09</span>, <span class="nu0" style="color:rgb(204,102,204)">0.09</span>, <span class="nu0" style="color:rgb(204,102,204)">0.10</span>
      zhanhailiang<span class="sy0" style="color:rgb(102,204,102)">@</span>linux-06bq:<span class="sy0" style="color:rgb(102,204,102)">/</span>usr<span class="sy0" style="color:rgb(102,204,102)">/</span>local<span class="sy0" style="color:rgb(102,204,102)">/</span>services<span class="sy0" style="color:rgb(102,204,102)">/</span>php<span class="sy0" style="color:rgb(102,204,102)">/</span>sbin<span class="sy0" style="color:rgb(102,204,102)">></span> top
       
      top - <span class="nu0" style="color:rgb(204,102,204)">17</span>:06:09 up <span class="nu0" style="color:rgb(204,102,204)">12</span> days,  <span class="nu0" style="color:rgb(204,102,204)">8</span>:<span class="nu0" style="color:rgb(204,102,204)">12</span>, <span class="nu0" style="color:rgb(204,102,204)">12</span> <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">users</span>,  load average: <span class="nu0" style="color:rgb(204,102,204)">0.09</span>, <span class="nu0" style="color:rgb(204,102,204)">0.09</span>, <span class="nu0" style="color:rgb(204,102,204)">0.10</span>
      Tasks: <span class="nu0" style="color:rgb(204,102,204)">182</span> total,   <span class="nu0" style="color:rgb(204,102,204)">1</span> running, <span class="nu0" style="color:rgb(204,102,204)">181</span> sleeping,   <span class="nu0" style="color:rgb(204,102,204)">0</span> stopped,   <span class="nu0" style="color:rgb(204,102,204)">0</span> zombie
      Cpu<span class="br0" style="color:rgb(102,204,102)">(</span>s<span class="br0" style="color:rgb(102,204,102)">)</span>: <span class="nu0" style="color:rgb(204,102,204)">30.4</span><span class="sy0" style="color:rgb(102,204,102)">%</span>us,  <span class="nu0" style="color:rgb(204,102,204)">0.3</span><span class="sy0" style="color:rgb(102,204,102)">%</span>sy,  <span class="nu0" style="color:rgb(204,102,204)">0.0</span><span class="sy0" style="color:rgb(102,204,102)">%</span>ni, <span class="nu0" style="color:rgb(204,102,204)">65.3</span><span class="sy0" style="color:rgb(102,204,102)">%</span><span class="kw2" style="color:rgb(0,0,0); font-weight:bold">id</span>,  <span class="nu0" style="color:rgb(204,102,204)">3.9</span><span class="sy0" style="color:rgb(102,204,102)">%</span>wa,  <span class="nu0" style="color:rgb(204,102,204)">0.0</span><span class="sy0" style="color:rgb(102,204,102)">%</span>hi,  <span class="nu0" style="color:rgb(204,102,204)">0.0</span><span class="sy0" style="color:rgb(102,204,102)">%</span>si,  <span class="nu0" style="color:rgb(204,102,204)">0.0</span><span class="sy0" style="color:rgb(102,204,102)">%</span>st
      Mem:   3944840k total,  3848844k used,    95996k <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">free</span>,   565464k buffers
      Swap:        0k total,        0k used,        0k <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">free</span>,   903548k cached
      问题: vim的基本快捷键. 

      请自行按Vim自带的30分教程练习.

      zhanhailiang<span class="sy0" style="color:rgb(102,204,102)">@</span>linux-06bq:~<span class="sy0" style="color:rgb(102,204,102)">></span> vimtutor 
      问题: ssh安全增强方法; 密码方式和rsa key方式的配置. 

      以我之前的博客《git/github教程》为例.

      问题: rpm/apt/yum/ports装包, 查询, 删除的基本命令. 
      问题: Makefile的基本&#26684;式, gcc编译, 连接的命令,-O0 和-O3区别. 
      问题: gdb, strace, valgrind的基本使用.

      4. 前端,HTML,JS

      问题: css盒模型. 

      《CSS盒模型》

      问题: javascript中的原型链prototype. 

      《JavaScript. The core.》

      问题: javascript中this对象分析. 

      以我之前的博客《深入理解JS之this进阶篇》为例. 其中归纳了所有的this场景.

      问题: IE和FF事件冒泡的不同. 

      1).IE中事件从最低层冒泡到最顶层的window, 事件对象从window.event中获取;

      2).FF先采取事件传播机制, 从最顶层的window到最底层的element, 再冒泡回到最顶层的window. 事件对象也不是全局的, 而是单独作为事件处理函数的参数传值.

      问题: 什么是怪异模式, 标准模式, 近标准模式. 

      《doctype声明、浏览器的标准、怪异等模式》,这篇博客总结的很详细.

      问题: DTD的定义.

      HTML 4.01有3种DTD定义头, XHTML 1.0有3种DTD定义头, HTML 5只有1种DTD定义. 活在2013+年, 请直接使用

      问题: IE/firefox常用hack.

      以《IE CSS hack》为例.

      <span class="re0" style="color:rgb(0,0,255)">#ml10</span> <span class="br0" style="color:rgb(102,204,102)">{</span>
          <span class="kw1" style="color:rgb(177,177,0)">margin-left</span><span class="sy0" style="color:rgb(102,204,102)">:</span><span class="re3" style="color:rgb(255,51,51); font-weight:bold">10px</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
          <span class="kw1" style="color:rgb(177,177,0)">margin-left</span><span class="sy0" style="color:rgb(102,204,102)">:</span><span class="re3" style="color:rgb(255,51,51); font-weight:bold">10px</span> !important<span class="sy0" style="color:rgb(102,204,102)">;</span> <span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/* Firefox、IE7&#43;支持 */</span>
          _margin-left<span class="sy0" style="color:rgb(102,204,102)">:</span><span class="re3" style="color:rgb(255,51,51); font-weight:bold">10px</span>           <span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/* IE6支持 */</span>
          <span class="sy0" style="color:rgb(102,204,102)">*</span><span class="kw1" style="color:rgb(177,177,0)">margin-left</span><span class="sy0" style="color:rgb(102,204,102)">:</span><span class="re3" style="color:rgb(255,51,51); font-weight:bold">10px</span>           <span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/* IE6、IE7支持 */</span>
          <span class="sy0" style="color:rgb(102,204,102)">*&#43;</span><span class="kw1" style="color:rgb(177,177,0)">margin-left</span><span class="sy0" style="color:rgb(102,204,102)">:</span><span class="re3" style="color:rgb(255,51,51); font-weight:bold">10px</span>          <span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/* IE7支持 */</span>
          <span class="kw1" style="color:rgb(177,177,0)">margin-left</span><span class="sy0" style="color:rgb(102,204,102)">:</span><span class="re3" style="color:rgb(255,51,51); font-weight:bold">10px</span>\<span class="nu0" style="color:rgb(204,102,204)">9</span><span class="sy0" style="color:rgb(102,204,102)">;</span>         <span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/* IE6、IE7、IE8支持 */</span>
          <span class="kw1" style="color:rgb(177,177,0)">margin-left</span><span class="sy0" style="color:rgb(102,204,102)">:</span><span class="re3" style="color:rgb(255,51,51); font-weight:bold">10px</span>\<span class="nu0" style="color:rgb(204,102,204)">0</span><span class="sy0" style="color:rgb(102,204,102)">;</span>         <span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/* IE8支持 */</span>
      <span class="br0" style="color:rgb(102,204,102)">}</span>
      问题: FF,IE下的前端js/css调试工具. 
      • FF: Firebug
      • IE: IE8+自带调试工具, 其它版本使用IEDebugbar
      • Chrome: 自带的开发工具
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article: php 基础求解,拜托诸位了。小女子这项有礼了! Next article: 关于PHP完事标签?>的使用细节

Related articles

See more