ÍƼö: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,Ó¦¸ÃÊDZÊÎó)ºÍ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
Ïà¹ØÎĵµ£º
תÔصÄPHPÃæÊÔÌâ
1. »ù±¾ÖªÊ¶µã
HTTPÐÒéÖм¸¸ö״̬ÂëµÄº¬Òå:503 500 401 200 301 302¡£¡£¡£
Include require include_once require_once µÄÇø±ð.
PHP/MysqlÖм¸¸ö°æ±¾µÄ½ø»¯Ê·£¬±ÈÈçmysql4.0µ½4.1£¬PHP 4.xµ½5.1µÄÖØ´ó¸Ä½øµÈµÈ¡£
HEREDOC½éÉÜ
д³öһЩphpħ»Ã·½·¨;
һЩ±àÒëphpʱµÄconfigure ²ÎÊý
Ïòphp´«Èë ......
»ù±¾Ë¼Â·£ºÍ¨¹ýSOCKETÇëÇóÆäËûPHP½Å²½£¬ÊµÏÖPHPµÄ¶à½ø³ÌµÄÒì²½Ö´ÐС£
·Ï»°¾Í²»¶à˵ÁË£¬Çë¿´ÏÂÃæµÄ½Å²½²¢Ö´ÐÐÖ®¡£
<?php
//a.php
function runThread(){
$fp = fsockopen('127.0.0.1', 82, $errno, $errmsg);
fputs($fp, "GET /a.php?act=b\r\n"); //ÕâÀïµÄµÚ¶þ¸ö²ÎÊýÊÇHTTPÐÒéÖй涨µÄÇëÇóÍ·
//²»Ã÷°×µÄÇë¿´RFCÖ ......
°ì·¨Ò»
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 ......
¡¡¡¡ËµÊµÔڵģ¬ÏÖÔÚµÄweb¿ª·¢È·ÊµºÜ»ð£¬µ«×ܾõµÃ¶ÔÎÒÀ´ËµÃ»ÓÐʲôÎüÒýÁ¦¡£Ëµµ½µ×£¬²»¹ýÊÇ×ö¸öÍøÕ¾ÂÓÐʲôÒâ˼£¿¾ÍËã×ö¸öÌÔ±¦Íø£¬ËãºÜÅ£ÁË°É£¬ÄÇÓÖÔõôÑù£¬²»¹ý¾ÍÊÇʵÏÖһЩ½»»¥²Ù×÷µÄÍøÕ¾°ÕÁË£¬×ܾõµÃ£¬Ã»Óж¯Á¦¡£
¡¡¡¡Æäʵ£¬´ÓÄÚÐÄÉî´¦£¬»¹ÊǾõµÃ×öÓÎÏ·ºÜÓÐÒâ˼¡£ÍæÓÎÏ·¸üÓÐÒâ˼£¬×ö³öƯÁÁµÄÓÎϷЧ¹û²ÅÊǷdz£Ë§µÄ¡£¾¡¹ ......
ÏÖÔÚÖ÷Á÷µÄÍøÕ¾¿ª·¢ÓïÑÔÎÞÍâºõasp¡¢php¡¢asp.net¡¢jspµÈ¡£
ÍøÒ³´Ó¿ªÊ¼¼òµ¥µÄhmtlµ½¸´ÔӵķþÎñÓïÑÔ£¬×ß¹ýÁË10¶à¸öÄêÍ·£¬¸÷ÖÖ¼¼Êõ²ã³ö²»Çµ¥¸öµÄÖ÷Á÷¼¼ÊõÒ²ÔÚ²»¶Ï·Ðµİ汾£¬ÏÖÔÚ·ÖÎöϸ÷ÖÖÓïÑÔµÄÇø±ð¡¢ÓÅÊÆ¡¢ÁÓÊÆ¡¢¿ª·¢×¢ÒâÊÂÏ
HTML:µ±È»ÕâÊÇÍøÒ³×î»ù±¾µÄÓïÑÔ,ÿһ¸ö·þÎñÆ÷ÓïÑÔ¶¼ÐèÒªËüµÄÖ§³Ö,Ҫѧϰ,Õâ¸ö¿Ï¶¨ÊÇ¿ªÊ¼ ......