据说是雅虎的一份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脚本数据库功能详解(上)
Oct 09 PHP
php网站来路获取代码(针对搜索引擎)
Jun 08 PHP
ubuntu 编译安装php 5.3.3+memcache的方法
Aug 05 PHP
浅析PHP程序设计中的MVC编程思想
Jul 28 PHP
浅谈php命令行用法
Feb 04 PHP
php实现字符串反转输出的方法
Mar 14 PHP
php获得网站访问统计信息类Compete API用法实例
Apr 02 PHP
常见的四种POST 提交数据方式(小总结)
Oct 08 PHP
PHP中array_keys和array_unique函数源码的分析
Feb 26 PHP
php格式文件打开的四种方法
Feb 24 PHP
laravel 时间格式转时间戳的例子
Oct 11 PHP
php 输出缓冲 Output Control用法实例详解
Mar 03 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
PHP转盘抽奖接口实例
2015/02/09 PHP
PHP+MariaDB数据库操作基本技巧备忘总结
2018/05/21 PHP
浅谈php使用curl模拟多线程发送请求
2019/03/08 PHP
列表内容的选择
2006/06/30 Javascript
JS对URL字符串进行编码/解码分析
2008/10/25 Javascript
js对象关系图 方便dom操作
2012/03/18 Javascript
javascript学习(二)javascript常见问题总结
2013/01/02 Javascript
js操作输入框提示信息且响应鼠标事件
2014/03/25 Javascript
JavaScript制作简单的日历效果
2016/03/10 Javascript
jQuery获取与设置iframe高度的方法
2016/08/01 Javascript
详解Node.js串行化流程控制
2017/05/04 Javascript
vue.js实现只弹一次弹框
2018/01/29 Javascript
AnglarJs中的上拉加载实现代码
2018/02/08 Javascript
vue 点击按钮增加一行的方法
2018/09/07 Javascript
vue日历/日程提醒/html5本地缓存功能
2019/09/02 Javascript
Vue的transition-group与Virtual Dom Diff算法的使用
2019/12/09 Javascript
原生JS实现天气预报
2020/06/16 Javascript
VUE 项目在IE11白屏报错 SCRIPT1002: 语法错误的解决
2020/09/27 Javascript
Python入门之三角函数全解【收藏】
2017/11/08 Python
python 多线程中子线程和主线程相互通信方法
2018/11/09 Python
基于django channel实现websocket的聊天室的方法示例
2019/04/11 Python
Python获取时间范围内日期列表和周列表的函数
2019/08/05 Python
python默认参数调用方法解析
2020/02/09 Python
使用Pyhton 分析酒店针孔摄像头
2020/03/04 Python
基于Python爬取51cto博客页面信息过程解析
2020/08/25 Python
SNIDEL官网:日本VIVI杂志人气少女第一品牌
2020/03/12 全球购物
捷克多品牌在线时尚商店:ANSWEAR.cz
2020/10/03 全球购物
银行职业规划书范文
2013/12/28 职场文书
马云的职业生涯规划之路
2014/01/01 职场文书
酒店保安领班职务说明书
2014/03/04 职场文书
社区义诊活动总结
2014/04/30 职场文书
国防教育标语
2014/10/08 职场文书
员工工作能力评语
2014/12/31 职场文书
挂靠协议书
2015/01/27 职场文书
员工升职自我评价
2019/03/26 职场文书
爱国之歌(8首)
2019/09/29 职场文书