PHP面试题附答案.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《PHP面试题附答案.docx》由会员分享,可在线阅读,更多相关《PHP面试题附答案.docx(7页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、PHP面试题附答案1.Whichofthefollowingwillnotaddjohntotheusersarray?1.$users=john2.array_add($users,john);3.array_push($users,john);4.$users|=johnAnswer:2,42.Whatsthedifferencebetweensort(),asort()andksort(),rsort()?Underwhatcircumstanceswouldyouuseeachofthese?sort():本函数对数组的值进行排序。当本函数结束时数组单元将被从最低到最高重新安排,arr
2、ay中的单元赋予新的键名。这将删除原有的键名而不仅是重新排序。asort():这个函数将数组的值重新排序,由小至大排列。数组的索引亦跟着值的顺序而变动。当您在程序中需要重新整理数组值的顺序时,就能够使用这个函数。ksort():对数组根据键名排序,保留键名到数据的关联。本函数主要用于关联数组。rsort():本函数对数组进行逆向排序(最高到最低)。与sort()执行相反的操作。3.Whatwouldthefollowingcodeprinttothebrowser?Why?$num=10;functionmultiply()$num=$num*10;multiply();echo$num;10
3、4.Whatisthedifferencebetweenareferenceandaregularvariable?Howdoyoupassbyreferencewhywouldyouwantto?passbyreferencelikethisfunctions($vars);itlikesmorefast;5.Whatfunctionscanyouusetoaddlibrarycodetothecurrentlyrunningscript?inlcude()orrequire();6.Whatisthedifferencebetweenfoo()foo()?iffoo()throwaerro
4、r,willbealert,butfoo()no;7.HowdoyoudebugaPHPapplication?xdebugorusedie()doit;8.Whatdoes=do?Whatsanexleofsomethingthatwillgivetruefor=,butnot=?=用于准确比拟ex:(=null)=truebut(=null)=false;9.Howwouldyoudeclareaclassnamedmyclasswithnomethodsorproperties?classmyclass10.Howwouldyoucreateanobject,whichisaninsta
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- PHP 试题 答案
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内