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...

面试题 相关文章推荐
PHP面试题及答案一
Jun 18 面试题
PHP面试题附答案
Nov 28 面试题
weblogic面试题
Mar 07 面试题
说出一些常用的类,包,接口
Sep 22 面试题
C++是不是类型安全的
Feb 18 面试题
介绍一下内联、左联、右联
Dec 31 面试题
木马的传播途径主要有哪些
Apr 08 面试题
linux面试题参考答案(6)
Jun 23 面试题
介绍一下XMLHttpRequest对象的常用方法和属性
May 24 面试题
如何清空Session
Feb 23 面试题
怎样声明一个匿名的内部类
Jun 01 面试题
J2EE面试题集锦(附答案)
Aug 16 面试题
PHP数据运算类型都有哪些
Nov 05 #面试题
一套PHP的笔试题
May 31 #面试题
新浪网技术部笔试题
Aug 26 #面试题
如何处理简单的PHP错误
Oct 14 #面试题
PHP面试题及答案二
May 23 #面试题
PHP经典面试题
Sep 03 #面试题
PHP面试题及答案一
Jun 18 #面试题
You might like
一段php加密解密的代码
2006/10/09 PHP
晋城吧对DiscuzX进行的前端优化要点
2010/09/05 PHP
php实现mysql数据库连接操作及用户管理
2015/11/08 PHP
PHP安装GeoIP扩展根据IP获取地理位置及计算距离的方法
2016/07/01 PHP
php 实现301重定向跳转实例代码
2016/07/18 PHP
PHP对称加密算法(DES/AES)类的实现代码
2017/11/14 PHP
PHP mkdir创建文件夹实现方法解析
2020/11/13 PHP
js加解密 脚本解密
2008/02/22 Javascript
用jQuery简化JavaScript开发分析
2009/02/19 Javascript
Prototype Hash对象 学习
2009/07/19 Javascript
将list转换为json失败的原因
2013/12/17 Javascript
javascript操作数组详解
2014/12/17 Javascript
js实现C#的StringBuilder效果完整实例
2015/12/22 Javascript
JavaScript实现数据类型的相互转换
2016/03/06 Javascript
Bootstrap页面布局基础知识全面解析
2016/06/13 Javascript
javascript汉字拼音互转的简单实例
2016/10/09 Javascript
JavaScript 限制文本框不可输入英文单双引号的方法
2016/12/20 Javascript
AngularJS ng-repeat指令中使用track by子语句解决重复数据遍历错误问题
2017/01/21 Javascript
Vue组件中的data必须是一个function的原因浅析
2018/09/03 Javascript
React+TypeScript+webpack4多入口配置详解
2019/08/08 Javascript
在Vue.js中使用TypeScript的方法
2020/03/19 Javascript
jquery实现拖拽小方块效果
2020/12/10 jQuery
JS相册图片抖动放大展示效果的示例代码
2021/01/29 Javascript
python正则表达式re模块详细介绍
2014/05/29 Python
使用python实现生成用户信息
2017/03/20 Python
python3+PyQt5重新实现自定义数据拖放处理
2018/04/19 Python
python代码过长的换行方法
2018/07/19 Python
如何用Python做一个微信机器人自动拉群
2019/07/03 Python
详解python实现数据归一化处理的方式:(0,1)标准化
2019/07/17 Python
AJAX应用和传统Web应用有什么不同
2013/08/24 面试题
介绍一下UNIX启动过程
2013/11/14 面试题
电焊工工作岗位职责
2014/02/06 职场文书
幼儿园优秀班主任事迹材料
2014/05/14 职场文书
艺术设计专业求职自荐信
2014/05/19 职场文书
2014年最新离婚协议书范本
2014/10/11 职场文书
提档介绍信范文
2015/10/22 职场文书