推荐:yahoo的php面试题
呵呵,翻译了篇东西,N长时间没用英语了,出了丑大家可一定要指出来啊。翻译自:Nick Halstead's Blog
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.
最近一位朋友得到了Yahoo的一些PHP面试题目,依照我之前发表关于程序员的相关文章的原则,我想我应该在这里发布出来,以给读者朋友们提供一些例
子,让大家看看像YAHOO这样的大公司关心哪些问题。
1. Which of the following will not add john to the users array?
1、下面哪个选项没有将 john 添加到users 数组中?
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?
2、sort(), asort()(注:原作者为assort,应该是笔误)和ksort()
三者之间有什么差别?你分别在什么情况下会使用上面三个函数?
3. What would the following code print to the browser? Why?
3、下面这段代码将在浏览器上打印出什么内容?为什么?
$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?
4、引用变量与普通变量之间有何区别?如何通过引用传值?在什么情况下会这样做?
5. What functions can you use to add library code to the currently
running script?
5、哪些函数可以被用来向当前的代码中添加库代码?
6. What is the difference between foo() & @foo()?
6、foo()和@foo
相关文档:
办法一
select * from V$NLS_PARAMETERS
$conn = oci_connect('scott', 'donkey', 'demo', 'zhs16gbk');
while ($dat = oci_fetch_row($cur)) {
print_r(iconv('gb2312', 'utf-8', $dat[0])); //$nickname = mb_convert_encoding($dat[0], 'utf-8', 'gbk');&n ......
1、使用单引号括起来的字符串
当使用双引号来括字符串时,PHP解释器会对其进行变量替换、转义等操作,如
“\n”。如果只想输出一个基本的字符串,用单引号会节省一些资源。当然,如果需要进行变量替换的,那就必须用双引号了。
2、字符串的输出
以下哪一条语句的运行速度最快?
print “Hi my name is ......
PHP4:奇迹背后
1995年时,Rasmus在用PHP写他的个人主页;今天,PHP成为风靡全球的脚本语言,越来越多的站点选择使用PHP,连Yahoo都放弃了自己的脚本而改用PHP支持它的网站。可以说,PHP是一个奇迹。我一直认为,任何奇迹背后都有它的原因。现在,就让我们透过这个奇迹,来看看PHP的成功之道。
1 简单易用
PHP的入门门槛 ......