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

php嵌入html

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


相关文档:

PHP 读取地址栏 参数


1.  $_GET

http://localhost/a.php?a=ok  
   
  <?  
  echo  
$_GET['a'];   //显示"ok"  
  ?>
2.  $_SERVER['QUERY_STRING']
http://localhost/a.php?a=1&b=2&c=3  
   
  ......

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

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

[PHP]PDO的使用

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';
......

[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号