8月份面试总结之TLconseil

来源:互联网 发布:软件开发阶段 英文 编辑:程序博客网 时间:2024/06/05 19:43

1. Doctype是什么?
<!DOCTYPE> 声明位于文档中的最前面的位置,处于 <html> 标签之前。此标签可告知浏览器文档使用哪种 HTML 或 XHTML 规范。
该标签可声明三种 DTD 类型,分别表示严格版本、过渡版本以及基于框架的 HTML 文档。
HTML 4.01 规定了三种文档类型:Strict、Transitional 以及 Frameset。
1)HTML Strict DTD:
如果您需要干净的标记,免于表现层的混乱,请使用此类型。请与层叠样式表(CSS)配合使用:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">
2)HTML Transitional DTD:
Transitional DTD 可包含 W3C 所期望移入样式表的呈现属性和元素。如果您的读者使用了不支持层叠样式表(CSS)的浏览器以至于您不得不使用 HTML 的呈现特性时,请使用此类型:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
3)Frameset DTD:
Frameset DTD 应当被用于带有框架的文档。除 frameset 元素取代了 body 元素之外,Frameset DTD 等同于 Transitional DTD:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "
http://www.w3.org/TR/html4/frameset.dtd">
PS:同时XHTML 1.0 也规定了三种 XML 文档类型:Strict、Transitional 以及Frameset。
FPI: Formal Public Identifier 正式公用标识
DTD:Document Type Definition文本类型定义
2. Quirks mode是什么?
Quirks mode怪异模式,是一种解析css的模式。
另一种是strcit mode
3. PDO
目前,有4种主流数据库抽象层:Metabase、PEAR:DB、PDO及ADODB。
从目前的应用来看,ADODB和PEAR:DB最受欢迎(因为PEAR是被捆绑在PHP目录中的,但PEAR:DB的效率问题一直引人诟病)。
从PHP 5开始出现的PDO及ADODB(其中包括PDO、MySQLi的底层实现)已经逐渐普及。
也有一些更新的抽象类值得一用,PEAR:MDB(现在的版本名称为PEAR:MDB2)已经将Metabase和PEAR:DB合并,并且效率较之从前有很大的提高。

The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver that implements the PDO interface can expose database-specific features as regular extension functions. Note that you cannot perform any database functions using the PDO extension by itself; you must use a database-specific PDO driver to access a database server.

PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility.

PDO ships with PHP 5.1, and is available as a PECL extension for PHP 5.0;

PDO requires the new OO features in the core of PHP 5, and so will not runwith earlier versions of PHP.

4. reference
http://www.google.com/support/webmasters/bin/answer.py?answer=35769

5.
5.1 PHP5.3改进
添加了namespace
语法:namespace Project::Module;
支持延迟静态绑定(Late Static Binding)
支持Closure闭包,lambda/anonymous函数
支持Nowdoc语法
新的垃圾收集器Garbage collector
修复了超过140个的bug

5.2 PHP5.2新特性:
支持Zip, JSON, Filter,Date扩展
改进了内存管理器

5.3 php4和php5的不同
php5使用了zend engine 2
SQLite 嵌入到了php
新加了MySQLi(improved MySQL)扩展
新的对象模型

6. Json
Javascript object notation

7. Ajax
Asyncronous JavaScript and XML

8. Css3的新功能
1) border边框
border-color: 边框颜色
如:
border: 8px solid #000;
-moz-border-bottom-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-top-colors:    #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-left-colors:   #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-right-colors:  #555 #666 #777 #888 #999 #aaa #bbb #ccc;
padding: 5px 5px 5px 15px;
border-image:
如:
    * border-image:边框图像
          o border-top-image
          o border-right-image
          o border-bottom-image
          o border-left-image

    * border-corner-image: 边框边角图像
          o border-top-left-image
          o border-top-right-image
          o border-bottom-left-image
          o border-bottom-right-image
border-radius:给边框加圆角
如:
border-top-left-radius: 10px 5px;
border-bottom-right-radius: 10% 5%;
border-top-right-radius: 10px;
div { 
    -moz-border-radius-topright: 6px; 
    -moz-border-radius-topleft: 6px; 
    -moz-border-radius-bottomright: 6px; 
    -moz-border-radius-bottomleft: 6px; 
    -webkit-border-top-right-radius: 6px; 
    -webkit-border-top-left-radius: 6px; 
    -webkit-border-bottom-right-radius: 6px; 
    -webkit-border-bottom-left-radius: 6px; 
    border-top-right-radius: 6px; 
    border-top-left-radius: 6px; 
    border-bottom-right-radius: 6px; 
    border-bottom-left-radius: 6px; 
    }
box-shadow:盒子阴影
box-shadow 属性可以对HTML元素添加阴影 而不用额外的标签或背景图片。
如:
box-shadow: -10px -10px 0px #000;
border-radius: 5px;
padding: 5px 5px 5px 15px;
2)Background背景
background-origin
background-clip
background-size背景大小,如:
-moz-background-size(firefox)
-o-background-size(opera)
-webkit-background-size(safari)
-khtml-background-size(konqueror)
Multiple backgrounds多背景,如:
background: url(body-top.gif) top left no-repeat,
url(banner_fresco.jpg)  top 11px no-repeat,
url(body-bottom.gif) bottom left no-repeat,
url(body-middle.gif) left repeat-y;
3)颜色
HSL(Hue色度, Saturation饱和度, Lightness亮度)颜色:
* Hue is a degree on the color wheel; 0 (or 360) is red, 120 is green, 240 is blue. Numbers in between reflect different

shades.
* Saturation is a percentage value; 100% is the full colour.
* Lightness is also a percentage; 0% is dark (black), 100% is light (white), and 50% is the average.
如:
<div style="background-color: hsl(0,100%, 50%);"></div>
<div style="background-color: hsl(120,100%, 50%);"></div>
<div style="background-color: hsl(240,100%, 50%);"></div>
HSLA(Hue色度, Saturation饱和度, Lightness亮度, Alpha):添加了设置透明度
<div style="background-color: hsla(0,100%,50%,0.2);"></div>
<div style="background-color: hsla(0,100%,50%,0.4);"></div>
<div style="background-color: hsla(0,100%,50%,0.6);"></div>
<div style="background-color: hsla(0,100%,50%,0.8);"></div>
<div style="background-color: hsla(0,100%,50%,1);"></div>
Opacity透明度:
如:
<div style=" background: rgb(255, 0, 0) ; opacity: 0.2;"></div>
<div style=" background: rgb(255, 0, 0) ; opacity: 0.4;"></div>
<div style=" background: rgb(255, 0, 0) ; opacity: 0.6;"></div>
<div style=" background: rgb(255, 0, 0) ; opacity: 0.8;"></div>
<div style=" background: rgb(255, 0, 0) ; opacity: 1;"></div>
RGBA(Red,Green,Blue,Alpha)
<div style="background: rgba(255, 0, 0, 0.2);"></div>
<div style="background: rgba(255, 0, 0, 0.4);"></div>
<div style="background: rgba(255, 0, 0, 0.6);"></div>
<div style="background: rgba(255, 0, 0, 0.8);"></div>
<div style="background: rgba(255, 0, 0, 1)  ;"></div>
4)Text effects文字效果
text-shadow:文本阴影
如:
text-shadow: 2px 2px 2px #000;
text-overflow:文本溢出
如:
text-overflow: ellipsis;
text-overflow: clip;
text-overflow: ellipsis-word;
word-wrap:它是用来防止太长的字符串溢出的。
如:
word-wrap:normal; 不起作用,跟不适用这个属性的结果相同
word-wrap:break-word; 用于把过长的词分开
5)User Interface用户界面:
box-sizing: content-box
-moz-box-sizing
-webkit-box-sizing
Resize:重定义大小
div.resize {
    width: 100px;
    height: 100px;
    border: 1px solid;
    resize: both;
    overflow: auto;
}
resize:both;
resize:vertical;
resize:horizonal;
outline轮廓
如:
outline-offset:12px;
nav-top, nav-right, nav-bottom, nav-left
6) Selectors选择器
attribute selectors属性选择器:
* [att^="value"]
 匹配包含以特定的值开头的属性的元素
* [att$="value"]
 匹配包含以特定的值结尾的属性的元素
* [att*="value"]
 匹配包含含有特定的值的属性的元素
p[title^="ho"] {background: green;}
p[title$="t"] {background: green;}
7)media queries媒体查询
媒体查询(media queries)可以让你为不同的设备基于它们的能力定义不同的样式。
#sidebar { 
    float: right; 
    display: inline; /* IE Double-Margin Bugfix */
}
@media all and (max-width:480px) { 
    #sidebar { 
        float: none; 
        clear: both; 
        } 
}
a { 
    color: grey; 

@media screen and (color){
    a { 
        color: red; 
    }  
}
8) multicolumn layout多栏布局
.index #content div { 
    -webkit-column-count : 4; 
    -webkit-column-gap : 20px; 
    -moz-column-count : 4; 
    -moz-column-gap : 20px; 
}
我们可以通过这个选择器定义三件事情:栏数(column-count)、栏宽(column-width、例子中没有用到)和各栏之间的空白/间距(column-gap)。

如果column-count未设定,浏览器会在允许的宽度内容纳尽可能多的栏目。
9) Web fonts @font-face
尽管是最被期待的CSS3 特性 (甚至它在CSS2中就已经被引入了), @font-face在网站上仍然没有像其它CSS3属性那样被广泛采用.这主要因为字体授权和版权问题:嵌入的字体很容易从网站上下载到,这是字体厂商的主要顾虑。
@font-face {
    font-family: Delicious;
    src: url('Delicious-Roman.otf');
}
@font-face {
    font-family: Delicious;
    font-weight: bold;
    src: url('Delicious-Bold.otf');
}


10) Speech语音
    * voice-volume
      使用从0到100的数字(0 即静音)、百分数或关键词(silent,x-soft,soft,medium,loud 和x-loud等)来设置音量。
    * voice-balance
      控制来自哪个声道(如果用户的音箱系统支持立体声)。
    * Speak
      指示屏幕阅读器阅读相关的文字、数字或标点符号。可用的关键词为none, normal, spell-out, digits, literal-punctuation, no-

punctuation 和inherit.
    * Pauses and rests
      在一个元素的被读完之前或之后设定暂停或停止。你可以使用时间单位(比如, “2s” 表示2 秒钟) 或关键词(none,x-weak, weak,

medium, strong 和x-strong)。
    * Cues
      使用声音限制特定元素并控制器音量。
    * voice-family
      设定特定的声音类型和声音合成(就像font-family)。
    * voice-rate
      控制阅读的速度。可以设置为百分数或关键词: x-slow, slow,medium, fast 和x-fast.
    * voice-stress
      指示应该使用的任何重音(强语气),使用不同的关键词: none, moderate,strong 和 reduced.
h2 { 
    voice-family: female; 
    voice-balance: left; 
    voice-volume: soft; 
    cue-after: url(sound.au); 



9. PHP框架

国外:CakePHP,CodeIgniter,  Prado, Zend, Symphony, Yii,  PHPDevShell, Akelos, Zoop, QPHP;

国内:ThinkPHP, FleaPHP


10. CMS

国外: Wordpress(blog), PHPBB(forum), Drupal, Joomla!, MediaWiki, e107, Plone(适合内部网站,服务器或文件发布系统),  Symphony

(XML,XSLT), Pligg(仿digg), TextPattern, Nucleus, Habari etc

国内: phpcms, dedecms etc


11. JavaScript库

jQuery, Mootools, Prototype, Dojo, Scriptaculous, ExtJs, Yui(Yahoo! User Interface Library),  UIZE,


12. PHP常见的库


图表库:下面的类库可以让你很简的创建复杂的图表和图片。当然,它们需要GD库的支持。
pChart - 一个可以创建统计图的库。
Libchart - 这也是一个简单的统计图库。
JpGraph - 一个面向对象的图片创建类。
Open Flash Chart - 这是一个基于Flash的统计图。

RSS 解析:解释RSS并是一件很单调的事情,不过幸好你有下面的类库可以帮助你方便地读取RSS的Feed。
MagpieRSS - 开源的PHP版RSS解析器,据说功能强大,未验证。
SimplePie - 这是一个非常快速,而且易用的RSS和Atom 解析库。

缩略图生成
phpThumb - 功能很强大,如何强大还是自己去体会吧。

支付
PHP Payment Library - 支持Paypal, Authorize.net 和2Checkout (2CO)

OpenID
PHP-OpenID - 支持OpenID的一个PHP库。OpenID是帮助你使用相同的用户名和口令登录不同的网站的一种解决方案。如果你对OpenID不熟悉的话,你可以到这里看看:http://openid.net.cn/

数据为抽象/对象关系映射ORM
ADOdb - 数据库抽象
Doctrine - 对象关系映射Object relational mapper (ORM) ,需要 PHP 5.2.3+ 版本,一个非常强大的database abstraction layer

(DBAL).
Propel - 对象关系映射框架- PHP5
Outlet - 也是关于对象关系映射的一个工具。

注:对象关系映射(Object Relational Mapping,简称ORM)是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术。 简单的说,ORM是通过使用描述对象和数据库之间映射的元数据,将程序中的对象自动持久化到关系数据库中。本质上就是将数据从一种形式转换到另外一种形式。 这也同时暗示者额外的执行开销;然而,如果ORM作为一种中间件实现,则会有很多机会做优化,而这些在手写的持久层并不存在。 更重要的是用于控制转换的元数据需要提供和管理;但是同样,这些花费要比维护手写的方案要少;而且就算是遵守ODMG规范的对象数据库依然需要类级别的元数据。

PDF 生成器
FPDF - 这量一个可以让你生成PDF的纯PHP类库。

Excel 相关
php-excel - 这是一个非常简单的Excel文件生成类。
PHP Excel Reader - 可以解析并读取XLS文件中的数据。

E-Mail 相关
Swift Mailer - 免费的超多功能的PHP邮件库。
PHPMailer - 超强大的邮件发送类。


单元测试

SimpleTest - 一个PHP的单元测试和网页测试的框架。
PHPUnit - 来自xUnit 家族,提供一个框架可以让你方便地进行单元测试的案例开发。并可非常容易地分析其测试结果。


13. IE7/8不支持Css3怎么解决
<!IE
  xxx
!>

14. Table head, foot, body组织:
结果如下:
<TABLE>
<THEAD>
     <TR> ...header information...
</THEAD>
<TFOOT>
     <TR> ...footer information...
</TFOOT>
<TBODY>
     <TR> ...first row of block one data...
     <TR> ...second row of block one data...
</TBODY>
<TBODY>
     <TR> ...first row of block two data...
     <TR> ...second row of block two data...
     <TR> ...third row of block two data...
</TBODY>
</TABLE>
tfoot必须在tbody之前出现,因为用户可以先显示出footer,然后再显示所有的数据。
TFOOT must appear before TBODY within a TABLE definition so that user agents can render the foot before receiving all of the (potentially numerous) rows of data.

 

15. Block 和Inline区别:

 

Block: Takes up the full width available, with a new line before and after (display:block;)
Inline:Takes up only as much width as it needs, and does not force new lines (display:inline;)
Not displayed:Some tags, like <meta /> and <style> are not visible (display:none;)

Block example

<p> tags and <div> tags are naturally displayed block-style.

<div>
Your general-purpose box
<h1> … <h6>
All headings
<p>
Paragraph
<ul>, <ol>, <dl>
Lists (unordered, ordered and definition)
<li>, <dt>, <dd>
List items, definition list terms, and definition list definitions
<table>
Tables
<blockquote>
Like an indented paragraph, meant for quoting passages of text
<pre>
Indicates a block of preformatted code
<form>
An input form

Inline example

Inline-display elements don’t break the flow. They just fit in with the flow of the document.

 

<span>
Your all-purpose inline element
<a>
Anchor, used for links (and also to mark specific targets on a page for direct linking)
<strong>
Used to make your content strong, displayed as bold in most browsers, replaces the narrower <b> (bold) tag
<em>
Adds emphasis, but less strong than <strong>. Usually displayed as italic text, and replaces the old <i> (italic) tag
<img />
Image
<br>
The line-break is an odd case, as it’s an inline element that forces a new line. However, as the text carries on on the next line, it’s not a block-level element.
<input>
Form input fields like
and
<abbr>
Indicates an abbr. (hover to see how it works)
<acronym>
Working much like the abbreviation, but used for things like this TLA.

 

 

原创粉丝点击