Loading...
<?php $en_dir = mcrypt_list_algorithms(); //返回Mcrypt支持的加密算法数组 echo "Mcrypt支持的算法有:"; foreach($en_dir as $en_value){ echo $en_value."<br />"; } ?&g...
首先创建个conn.php文件,用于连接MYSQL。<?php $conn=mysql_connect("localhost","root","root") or die("数据库连接失败".mysql_error()); //连接服务器 mysql_select_db("d...
<?php //MYSQL连接操作 $conn = mysql_connect("localhost","root","root") or die("数据库链接错误".mysql_error()); mysql_select_db("db_database15",$con...
<?php header("Content-Type: text/html; charset=utf-8"); //编辑输出编码 set_error_handler('myHandler'); //自定义错误处理函数 function myHandler($code, $msg, $file, $line) { echo ...
异常处理类<?php class Exception { protected $message = 'Unknown exception'; // 异常信息 protected $code = 0; // 用户自定义异常代码 protected $file; ...
判断出得价格是否能卖商品,如果可以同时计算自己身上还剩多少钱。主要是学习下,$this->money = $this->money - $mybid; 类似这样的用法。<?php header("Content-Type: text/html; charset=utf-8"); //编辑输出编码 class Me { pri...
<?php class MsubStr{ function csubstr($str, $start, $len) { //$str指的是字符串,$start指的是字符串的起始位置,$len指的是长度。 $strlen = $start + $len; //用$strlen存储字符串...
简单的通过类检测用户名和密码有没有填写。成员方法,没有声明成员变量,生成对象后套入提交的用户名和密码。<?php class CheckFrom1 { function ShowInfo ($username,$passwd){ //声明成员方法SHOWINFO,并定义两个变量 if ($username != '...