Yahoo的PHP面试题


Posted in 面试题 onMay 26, 2014
A friend recently got some pre-interview questions from YAHOO for a PHP job. Following up my previous post about programmer questions I thought I would post them to give people examples of what a large corporation like YAHOO asks.
1. Which of the following will not add john to the users array?
1. $users[] = ‘john’;
2. array_add($users,’john’);
3. array_push($users,‘john’);
4. $users ||= ‘john’;
2. What’s the difference between sort(), assort() and ksort? Under what circumstances would you use each of these?
3. What would the following code print to the browser? Why?
$num = 10;
function multiply(){
$num = $num * 10;
}
multiply();
echo$num;
4. 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()
14. What function can you use to open a file for reading and writing?
1. fget();
2. file_open();
3. fopen();
4. open_file();
15. 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’;
printereg_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.

Tags in this post...

面试题 相关文章推荐
Ibatis如何调用存储过程
May 15 面试题
怎么处理XML的中文问题
Mar 26 面试题
Java工程师面试集锦之Spring框架
Jun 16 面试题
将n个数按输入顺序的逆序排列,用函数实现
Nov 14 面试题
西安众合通用.net笔试题
Mar 18 面试题
介绍一下.NET构架下remoting和webservice
May 08 面试题
STP协议的主要用途是什么?为什么要用STP
Dec 20 面试题
局域网标准
Sep 10 面试题
飞利信loadrunner和软件测试笔试题
Sep 22 面试题
EJB包括(SessionBean,EntityBean)说出他们的生命周期,及如何管理事务的
Jul 24 面试题
遇到的Mysql的面试题
Jun 29 面试题
九州传奇上机题
Jul 10 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
php 正则 过滤html 的超链接
2009/06/02 PHP
php MYSQL 数据备份类
2009/06/19 PHP
php中使用Curl、socket、file_get_contents三种方法POST提交数据
2011/08/12 PHP
PHP获取真实客户端的真实IP
2017/03/07 PHP
PHP实现ASCII码与字符串相互转换的方法
2017/04/29 PHP
PHP的微信支付接口使用方法讲解
2019/03/08 PHP
PHP7 安装event扩展的实现方法
2019/10/08 PHP
JS仿flash上传头像效果实现代码
2011/07/18 Javascript
解决js正则匹配换行问题实现代码
2012/12/10 Javascript
js函数中onmousedown和onclick的区别和联系探讨
2013/05/19 Javascript
js实现将选中值累加到文本框的方法
2015/08/12 Javascript
AngularJS 应用身份认证的技巧总结
2016/11/07 Javascript
jquery删除数组中重复元素
2016/12/05 Javascript
AngularJs中Bootstrap3 datetimepicker使用实例
2016/12/13 Javascript
webpack external模块的具体使用
2018/03/10 Javascript
微信小程序左右滚动公告栏效果代码实例
2019/09/16 Javascript
js实现课堂随机点名系统
2019/11/21 Javascript
vue swipeCell滑动单元格(仿微信)的实现示例
2020/09/14 Javascript
[01:14]DOTA2亚洲邀请赛小组赛赛前花絮
2017/03/27 DOTA
Python 初始化多维数组代码
2008/09/06 Python
Python对象类型及其运算方法(详解)
2017/07/05 Python
pycharm 在windows上编辑代码用linux执行配置的方法
2018/10/27 Python
python+tkinter实现学生管理系统
2019/08/20 Python
Python图像处理模块ndimage用法实例分析
2019/09/05 Python
python定时任务 sched模块用法实例
2019/11/04 Python
Python urlencode和unquote函数使用实例解析
2020/03/31 Python
python的launcher用法知识点总结
2020/08/07 Python
2分钟教你实现环形/扇形菜单(基础版)
2020/01/15 HTML / CSS
HTML5 Canvas中使用用路径描画圆弧
2015/01/01 HTML / CSS
美国五金商店:Ace Hardware
2018/03/27 全球购物
介绍一下grep命令的使用
2012/06/28 面试题
绿色环保家庭事迹材料
2014/08/31 职场文书
2014年审计工作总结
2014/11/17 职场文书
如何写新闻稿
2015/07/18 职场文书
关于军训的感想
2015/08/07 职场文书
2019年圣诞节祝福语集锦
2019/12/25 职场文书