据说是雅虎的一份PHP面试题附答案


Posted in PHP onJanuary 07, 2009

从网上搜集到的,据说是雅虎的面试题。
1. Which of the following will not add john to the users array?
1. $users[] = 'john';
2. array_add($users,'john'); //wrong
3. array_push($users,'john');
4. $users ||= 'john'; //wrong
2. What's the difference between sort(), asort() and ksort? Under what circumstances would you use each of these?
my an:sort()-排序 asort()-保持key值排序 ksort()-以key顺序排序 rsort()-逆排序 arsort()-保持key值逆排序 krsort()-以key逆顺序排序
3. What would the following code print to the browser? Why?
$num = 10;
function multiply()
{
$num = $num * 10;
}
multiply();
echo $num;
my an:10 because var scope4. What is the difference between a reference and a regular variable? How do you pass by reference & why would you want to?
5. What functions can you use to add library code to the currently running script?
6. What is the difference between foo() & @foo()?
7. How do you debug a PHP application?
8. What does === do? What's an example of something that will give true for ‘==', but not ‘==='?
9. How would you declare a class named “myclass” with no methods or properties?
10. How would you create an object, which is an instance of “myclass”?
11. How do you access and set properties of a class from within the class?
12. What is the difference between include & include_once? include & require?
13. What function would you use to redirect the browser to a new page?
1. redir() 2. header() 3. location() 4. redirect()
my an :2
14. What function can you use to open a file for reading and writing?
1. fget(); 2. file_open(); 3. fopen(); 4. open_file();my an :315. What's the difference between mysql_fetch_row() and mysql_fetch_array()?
16. What does the following code do? Explain what's going on there.
$date='08/26/2003'; print ereg_replace(“([0-9]+)/([0-9]+)/([0-9]+)”,2/1/3,$date);17. Given a line of text $string, how would you write a regular expression to strip all the HTML tags from it?
18. What's the difference between the way PHP and Perl distinguish between arrays and hashes?
19. How can you get round the stateless nature of HTTP using PHP?
20. What does the GD library do?
21. Name a few ways to output (print) a block of HTML code in PHP?
22. Is PHP better than Perl? ? Discuss.

PHP 相关文章推荐
php基础知识:控制结构
Dec 13 PHP
PHP stream_context_create()作用和用法分析
Mar 29 PHP
ThinkPHP的RBAC(基于角色权限控制)深入解析
Jun 17 PHP
php检测apache mod_rewrite模块是否安装的方法
Mar 14 PHP
在Windows系统下使用PHP生成Word文档的教程
Jul 03 PHP
PHP封装CURL扩展类实例
Jul 28 PHP
php实现图片缩略图的方法
Mar 29 PHP
php通过smtp邮件验证登陆的方法
May 11 PHP
php中使用websocket详解
Sep 23 PHP
php-msf源码详解
Dec 25 PHP
PHP使用观察者模式处理异常信息的方法详解
Sep 24 PHP
Laravel jwt 多表(多用户端)验证隔离的实现
Dec 18 PHP
PHP 地址栏信息的获取代码
Jan 07 #PHP
php 禁止页面缓存输出
Jan 07 #PHP
php 时间计算问题小结
Jan 04 #PHP
PHP 常用函数库和一些实用小技巧
Jan 01 #PHP
php zlib压缩和解压缩swf文件的代码
Dec 30 #PHP
PHP HTML代码串截取代码
Dec 29 #PHP
PHP MSSQL 存储过程的方法
Dec 24 #PHP
You might like
fleaphp crud操作之find函数的使用方法
2011/04/23 PHP
解析如何用php screw加密php源代码
2013/06/20 PHP
PHP实现定时执行任务的方法
2014/10/05 PHP
Javascript 面向对象编程(一) 封装
2011/08/28 Javascript
使用js操作cookie的一点小收获分享
2013/09/03 Javascript
javascript判断两个IP地址是否在同一个网段的实现思路
2013/12/13 Javascript
JQuery插件fancybox无法在弹出层使用左右键的解决办法
2013/12/25 Javascript
JS实现的自定义右键菜单实例二则
2015/09/01 Javascript
再谈JavaScript异步编程
2016/01/27 Javascript
基于BootStrap Metronic开发框架经验小结【二】列表分页处理和插件JSTree的使用
2016/05/12 Javascript
JS碰撞运动实现方法详解
2016/12/15 Javascript
angular.js 路由及页面传参示例
2017/02/24 Javascript
JS简单生成随机数(随机密码)的方法
2017/05/11 Javascript
jQuery简介_动力节点Java学院整理
2017/07/04 jQuery
jQuery实现可兼容IE6的遮罩功能详解
2017/09/19 jQuery
vue mintui-Loadmore结合实现下拉刷新和上拉加载示例
2017/10/12 Javascript
浅谈Vue.use的使用
2018/08/29 Javascript
jQuery是用来干什么的 jquery其实就是一个js框架
2021/02/04 jQuery
[04:44]DOTA2英雄梦之声_第12期_矮人直升机
2014/06/21 DOTA
[44:15]国士无双DOTA2 6.82版本详解(上)
2014/09/28 DOTA
Python中列表、字典、元组、集合数据结构整理
2014/11/20 Python
Python脚本判断 Linux 是否运行在虚拟机上
2015/04/25 Python
Python数据可视化正态分布简单分析及实现代码
2017/12/04 Python
利用python将json数据转换为csv格式的方法
2018/03/22 Python
解决python读取几千万行的大表内存问题
2018/06/26 Python
html5 canvas实现跟随鼠标旋转的箭头
2016/03/11 HTML / CSS
Canvas制作旋转的太极的示例
2018/03/09 HTML / CSS
法国设计制造的扫帚和刷子:Andrée Jardin
2018/12/06 全球购物
杭州龙健科技笔试题.net部分笔试题
2016/01/24 面试题
市优秀教师事迹材料
2014/02/05 职场文书
食品安全工作实施方案
2014/03/26 职场文书
敬老院活动总结
2014/04/28 职场文书
四风问题民主生活会对照检查材料思想汇报
2014/09/27 职场文书
饭店服务员岗位职责
2015/02/09 职场文书
成功的商业计划书这样写才最靠谱
2019/07/12 职场文书
Pytorch 如何加速Dataloader提升数据读取速度
2021/05/28 Python