每日一题(17)

上一篇 / 下一篇  2007-10-28 21:40:45 / 个人分类:每日一题

11. What will the following scrīpt output?

<?php

ob_start();

for ($i = 0; $i < 10; $i++) {

echo $i;

}

$output = ob_get_contents();

ob_end_clean();

echo $ouput;

?>

A. 12345678910

B. 1234567890

C. 0123456789

D. Nothing

E. A notice

Answer:

Yet another question designed to see how well you recognize bugs in a scrīpt. Did you notice that, at the end of the scrīpt, the $output variables name is misspelled in the echo statement? The scrīpt will output a notice and, therefore, Answer E is correct.

(Do you feel most funny? I think a great many guys will pick c (Including myself!), but the auther gave us a surprise! Without his explanation, you would think I lose a letter in word 'output') 


12. By default, PHP stores session data in ________________.

A. The filesystem

B. A database

C. Virtual memory

D. Shared memory

E. None of the above

Answer:

The filesystem (Answer A). By default, PHP stores all session information in the /tmp folder; users of operating systems where this folder doesnt exist (such as Windows) must change the default value of the session.save_path php.ini setting to a directory appropriate for their setup (e.g.: C:\Temp).


TAG: 每日一题

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 15927
  • 日志数: 87
  • 建立时间: 2007-09-29
  • 更新时间: 2008-04-15

RSS订阅

Open Toolbar