据说是雅虎的一份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数据缓存技术
Feb 14 PHP
在PHP中使用Sockets 从Usenet中获取文件
Jan 10 PHP
PHP写入WRITE编码为UTF8的文件的实现代码
Jul 07 PHP
Windows下部署Apache+PHP+MySQL运行环境实战
Aug 31 PHP
详解php的魔术方法__get()和__set()使用介绍
Sep 19 PHP
PHP的构造方法,析构方法和this关键字详细介绍
Oct 22 PHP
codeigniter框架The URI you submitted has disallowed characters错误解决方法
May 06 PHP
destoon整合ucenter后注册页面不跳转的解决方法
Jun 21 PHP
php简单判断文本编码的方法
Jul 30 PHP
PHP入门教程之会话控制技巧(cookie与session)
Sep 11 PHP
PHP中函数gzuncompress无法使用的解决方法
Mar 02 PHP
PHP中abstract(抽象)、final(最终)和static(静态)原理与用法详解
Jun 05 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生成带有雪花背景的验证码
2006/10/09 PHP
配置最新的PHP加MYSQL服务器
2006/10/09 PHP
WordPres对前端页面调试时的两个PHP函数使用小技巧
2015/12/22 PHP
showModalDialog 和 showModelessDialog
2007/01/22 Javascript
window.dialogArguments 使用说明
2011/04/11 Javascript
node.js中的console.warn方法使用说明
2014/12/09 Javascript
node.js中的fs.fchownSync方法使用说明
2014/12/16 Javascript
jQuery-1.9.1源码分析系列(十)事件系统之事件包装
2015/11/20 Javascript
js倒计时简单实现方法
2015/12/17 Javascript
javascript类型系统——日期Date对象全面了解
2016/07/13 Javascript
jQuery中DOM节点删除之empty与remove
2017/01/20 Javascript
详解vue-cli本地环境API代理设置和解决跨域
2017/09/05 Javascript
jQuery实现的粘性滚动导航栏效果实例【附源码下载】
2017/10/19 jQuery
bmob js-sdk 在vue中的使用教程
2018/01/21 Javascript
Vue中props的使用详解
2018/06/15 Javascript
[01:09:01]完美世界DOTA2联赛循环赛 Magma vs PXG BO2第一场 10.28
2020/10/28 DOTA
python缩进区别分析
2014/02/15 Python
Python Web框架Flask中使用百度云存储BCS实例
2015/02/08 Python
python定时器(Timer)用法简单实例
2015/06/04 Python
举例讲解Python面相对象编程中对象的属性与类的方法
2016/01/19 Python
Python 专题二 条件语句和循环语句的基础知识
2017/03/19 Python
Python排序搜索基本算法之希尔排序实例分析
2017/12/09 Python
python自动重试第三方包retrying模块的方法
2018/04/24 Python
Tensorflow使用tfrecord输入数据格式
2018/06/19 Python
Python结合百度语音识别实现实时翻译软件的实现
2021/01/18 Python
python向xls写入数据(包括合并,边框,对齐,列宽)
2021/02/02 Python
解决Pycharm 运行后没有输出的问题
2021/02/05 Python
matplotlib grid()设置网格线外观的实现
2021/02/22 Python
意大利制造的男鞋和女鞋:SCAROSSO
2018/03/07 全球购物
卫校护理专业毕业生求职信
2013/11/26 职场文书
幸福中国演讲稿
2014/09/12 职场文书
银行反四风对照检查材料
2014/09/29 职场文书
白酒代理协议书范本
2014/10/26 职场文书
2014年后勤工作总结
2014/11/18 职场文书
个人催款函范文
2015/06/23 职场文书
《游戏王:大师决斗》新活动上线 若无符合卡组可免费租用
2022/04/13 其他游戏