易截截图软件、单文件、免安装、纯绿色、仅160KB

php嵌入html

<?php
function outputMyName($fname) {
   echo "我的名字叫 ";
    echo "周 ".$fname."<br />";
}
 ?>
<html>
<body>
<?php
outputMyName("胜超");
outputMyName("宇恒");
outputMyName("宇盟");
?>
</body>
</html>
结果如下:
我的名字叫 周 胜超
我的名字叫 周 宇恒
我的名字叫 周 宇盟


相关文档:

PHP 中判断、循环的几种写法

下面介绍几种PHP中判断、循环的几种写法。
最普通的判断:
<?php
if( $args != NULL )
{
call_func($args);
}
?>
对于单行的执行语句,可以写成:
<?php
if( $args != NULL ) call_func($args);
?>
也可以使用引号的方式。
<?php
if( $args != NULL ):
call_func($args); ......

PHP 中获取文件名及路径


  为了脚本程序的兼容性,很多时候脚本的名称都不是固定的。所以我们需要通过动态获取当前脚本的路径、文件名来完成某些功能。
  PHP 中,我们可以使用常量 __FILE__ 来获取当前被执行脚本的完整路径。
  注意:当包含此变量的脚本被其他脚本include或者require的时候, __FILE__ 将仍然返回此脚本的地址,而不是 ......

PHP验证码生成脚本(5位数字png格式)


<?php
header("Content-Type:image/png");
srand((double)microtime()*1000000);
$img_height=20;
$img_width=60;
$im=@imagecreate($img_width,$img_height) or die("不能初始化GD文件流");
$background_color=imagecolorallocate($im,255,255,255);
$text_color=imagecolorallocate($im,233,14,91);
......

[PHP]Smarty的使用

<?php
define('SMARTY_TMP_DIR','C:/php5/Smarty-2.6.13/');
define('SMARTY_DIR','C:/php5/Smarty-2.6.13/libs/'); //SMARTY_DIR ->smarty keyword,must be defined as libs dectory
require_once(SMARTY_DIR.'Smarty.class.php');
//建立一个smarty对象
$smarty = new Smarty;
$smarty->template_dir = ......

PHP生成随机字符串的方法

Code:
<?php
function genRandomString($len)
{
$chars = array(
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", 
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", 
"w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", 
"H", "I", "J", "K", "L", "M", "N", "O", ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号