每日一题(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 variable’s
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 doesn’t
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).
相关阅读:
- 每日一题(7) (chenz1117, 2007-10-16)
- 每日一题(8) (chenz1117, 2007-10-17)
- 每日一题(9) (chenz1117, 2007-10-18)
- 每日一题(10) (chenz1117, 2007-10-19)
- 每日一题(11) (chenz1117, 2007-10-21)
- 每日一题(12) (chenz1117, 2007-10-22)
- 每日一题(13) (chenz1117, 2007-10-23)
- 每日一题(14) (chenz1117, 2007-10-24)
- 每日一题(15) (chenz1117, 2007-10-25)
- 每日一题(16) (chenz1117, 2007-10-27)
导入论坛
收藏
分享给好友
管理
举报
TAG:
每日一题