2013年12月
PHP的require()函数
共将创建3个文件,header.php为网页头部,index.php为主体内容,footer.php为底部。
header.php文件内容
<html> <head> <title>PHP的require()函数</title> <style> p{font-size:24px;color:#FF0000;} </style> </head> <body>
footer.php文件内容
</body> </html>
index.php主体文件内容
<?php require('header.php'); ?> <p>Here is the content for this page</p> <?php require('footer.php'); ?>
浏览器输出内容
<html> <head> <title>PHP的require()函数</title> <style> p{font-size:24px;color:#FF0000;} </style> </head> <body><p>Here is the content for this page</p> </body> </html>
向上吧!
对美好的事物总是有许多的期待与向往,这是驱使人前进的动力。与现实碰撞时,不时可以碰出血花,这可以让人清醒,不至于总是沉醉在幻想中。时间在慢慢流失,没有任何征兆,无法挽留。你无法控制未来,却可以控制现在,该放弃的东西,一定要舍弃,以便可以走的更远,欣赏更多人生沿途的风景。
有些人,有些事,无法留住,就让她去吧。时间会将这些事淡化,直致你想起无法对这件事有任何情感。生活,总是有许多的意外,总是会有许多的不满意,如果总是抱怨,该怎么去享受上帝赐给我们的生命。
如果你的面容还有些幼气,何必去刻意伪装深沉。真正经历了,体验了世事百态,才能有的气质不是你留一把胡茬,憋出严肃,所能装的出来的。
向上吧!去勇敢的面对你的生活。
PHP数组元素随机排序
<?php $pictures = array('1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg'); shuffle($pictures); ?> <html> <head> <title>Bob's Auto Parts</title> </head> <body> <h1>Bob's Auto Parts</h1> <div align="center"> <table width=100%> <tr> <?php for ($i=0;$i<3;$i++){ echo "<td align=\"center\"><img src=\""; echo $pictures[$i]; echo "\"></td>"; } ?> </tr> </table> </div> </body> </html>