php URL编码解码函数代码
<?php
$url = "http://www.gimoo.net";
echo urlencode($url); //输出编码后的字符串
?>
<?php
$url = "http://www.gimoo.net";
$newurl = urlencode($url); //首先对$url进行编码
echo urldecode($newurl); //输出解码后的字符串
?>
php 表单数据的获取代码
htmlheadtitleForm/titlemetahttp-equiv="Content-Type"content="text/html;charset=gb2312"/headbodyformaction="post.php"method="get"name="form1"tablewidth="271"border="0"align="center"cellpadding="0"cells
php 异常处理实现代码
?php$path="D:\in.txt";try//检测异常{file_open($path);}catch(Exception$e)//捕获异常{echo$e-getMessage();}functionfile_open($path){if(!file_exists($path))//如果文件无法找到,抛出异
php session 预定义数组
?phpsession_start();$_SESSION['username']="zhuzhao";??phpsession_start();echo$_SESSION['username'];?
编辑:编程语言
标签:异常,字符串,代码,数组,表单