php嵌入html
<?php
function outputMyName($fname) {
echo "我的名字叫 ";
echo "周 ".$fname."<br />";
}
?>
<html>
<body>
<?php
outputMyName("胜超");
outputMyName("宇恒");
outputMyName("宇盟");
?>
</body>
</html>
结果如下:
我的名字叫 周 胜超
我的名字叫 周 宇恒
我的名字叫 周 宇盟
相关文档:
开源建站程序让编程高手和只懂打字上网的人都可以快速建立一个功能强大、界面漂亮的网站。不管你是想建一个博客、论坛、CMS、电子商务网站,或是Wiki、相册管理、RSS聚合和类Digg网站。你都可以通过这些建站工具快速建立。
我们之前介绍过23个开源的CMS管理系统,现在则让我们来看一下26款开源建站程序。
国外PHP开源建 ......
下面介绍几种PHP中判断、循环的几种写法。
最普通的判断:
<?php
if( $args != NULL )
{
call_func($args);
}
?>
对于单行的执行语句,可以写成:
<?php
if( $args != NULL ) call_func($args);
?>
也可以使用引号的方式。
<?php
if( $args != NULL ):
call_func($args);
......
<?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);
......
1. 安装php5.1以上的版本,有支持pdo!为了使你的环境能提供对pdo的支持!在php.ini文件加入以下:
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_pdo_mssql.dll(支持mssql数据库)
2. 以下为PH中PDO的具体使用
<?php
$dsn = 'mysql:dbname=MyDbName;host=localhost';
$user = 'root';
......
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", ......