Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÍÆ¼ö: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¶à½ø³ÌЭ×÷±à³ÌÖ® popen

ʹÓÃpopen½áºÏSHELLÃüÁîÒ²¿ÉÒÔʵÏÖ¶à½ø³Ì²¢·¢±à³Ì¡£
ʵÀýÈçÏ£º
<?php
//b.phpÎļþ
$file = 'testdir/file.txt';
for ($i=0;$i<10;$i++){
    $fp = fopen($file,'a+');
    fputs($fp, $i.'\r\n');
    fclose($fp);
    sleep(1);
}
?> ......

10ÌõPHP±à³Ìϰ¹ßÖúÄãÕÒ¹¤×÷

1¡¢Ê¹Óõ¥ÒýºÅÀ¨ÆðÀ´µÄ×Ö·û´®
µ±Ê¹ÓÃË«ÒýºÅÀ´À¨×Ö·û´®Ê±£¬PHP½âÊÍÆ÷»á¶ÔÆä½øÐбäÁ¿Ìæ»»¡¢×ªÒåµÈ²Ù×÷£¬Èç
“\n”¡£Èç¹ûÖ»ÏëÊä³öÒ»¸ö»ù±¾µÄ×Ö·û´®£¬Óõ¥ÒýºÅ»á½ÚʡһЩ×ÊÔ´¡£µ±È»£¬Èç¹ûÐèÒª½øÐбäÁ¿Ìæ»»µÄ£¬ÄǾͱØÐëÓÃË«ÒýºÅÁË¡£
2¡¢×Ö·û´®µÄÊä³ö
ÒÔÏÂÄÄÒ»ÌõÓï¾äµÄÔËÐÐËÙ¶È×î¿ì£¿
print “Hi my name is ......

PHP»ù´¡Ñ§Ï°±Ê¼ÇÖ®»ù±¾Óï·¨

   php»ù´¡Ñ§Ï°ÒѾ­²î²»¶àÁË,µ«ÊÇΪ¼ìÑé×Ô¼ºµÄÑ§Ï°ÕÆÎÕÇé¿ö,°Ñphp»ù´¡ÖªÊ¶»Ø¹Ë¸´Ï°ÁËÒ»ÏÂ
µÚÒ»¸öPHP³ÌÐò
<?php
echo "Hello World!";
?>
1 ×¢ÊÍ
1.1¶àÐÐ
/*
xxxx
*/
1.2µ¥ÐÐ
//xxxxx
2. ¸³Öµ
$a = 'test';
2.1 ¼ì²é±äÁ¿ÊÇ·ñÒÑÉùÃ÷
isset($a)
2.2 ÊͷűäÁ¿
unset($a);
2.3 ¾² ......

PHPÈëÃŵÄѧϰ·½·¨


ÿ¸öÈ˵Äѧϰ·½Ê½²»Í¬£¬Ð´ÕâÆªÎÄÕµÄÄ¿µÄÊÇ·ÖÏíÒ»ÏÂ×Ô¼ºµÄѧϰ¹ý³Ì£¬½ö¹©²Î¿¼£¬²»ÒªÒ»Î¶µÄÓñðÈ˵Äѧϰ·½·¨£¬ÕÒ¶Ô×Ô¼ºÓÐÓõÄѧϰ·½Ê½
¡¡¡¡¾­³£ÔÚijЩÂÛ̳ºÍQQȺÀï¿´µ½Ò»Ð©ÅóÓÑ»áÎÊ“ÔõÑù²ÅÄÜѧºÃPHP£¬ÔõÑù²ÅÄÜѧºÃ***ÓïÑÔ ”£¬µ«±ðÈ˻شð×î¶àµÄÊÇ£º´Ó×òµ¥”µÄ¿ªÊ¼¡£
¡¡¡¡Õâ¸ö¼òµ¥Ò²ÐíÕæµÄ²»¼òµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ