php 获取用户浏览器版本代码在php中我们有个全局变量$_SERVER[HTTP_USER_AGENT];可以获取用户所有信息,我们要经过处理才可以判断用户浏览器是那种型的,下面的函数就可以准确的用户浏览器版本号代码。
php常用正则表达式函数
php常用正则表达式函数我们这里面很多中正则表达式代码,包括有判断中文正则,数字字母正则,字符正则表达试,数字正则表达试,邮箱正则表达式,电话号码正则表达试,手机号码正则表达试,邮编正则表达试,/url正则表达试等哦。
jqGrid 导出excel表格代码(php+jqgrid实例)
jqgrid 导出excel表格代码(php教程+jqgrid实例)
require_once ../../../tabs.php;
?>
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html>
<head>
<title>jqgrid php demo</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css教程" media="screen" href="../../../themes/redmond/jquery-ui-1.7.1.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../../../themes/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../../../themes/ui.multiselect.css" />
<style type="text">
html, body {
margin: 0; /* remove body margin/padding */
padding: 0;
overflow: hidden; /* remove scroll bars on browser window */
font-size: 75%;
}
</style>
<script src="../../../网页特效/jquery.网页特效" type="text/网页特效"></script>
<script src="../../../js/i18n/grid.locale-en.js" type="text/网页特效"></script>
<script type="text/javascript">
$.jgrid.no_legacy_api = true;
$.jgrid.usejson = true;
</script>
<script src="../../../js/jquery.jqgrid.min.js" type="text/javascript"></script>
<script src="../../../js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
</head>
<body>
<div>
<?php include ("http://pic1.phprm.com/2013/09/05/grid.jpg");?>
</div>
<br/>
<?php tabs(array("grid.php"));?>
</body>
</html>
php 分页函数
php 静态文件生成类
php教程 静态文件生成类
defined(php教程ox) or die(header("http/1.1 403 not forbidden"));
class include_createstatic
{
private $htmlpath = ;
private $path = ;
public $monthpath = ;
private $listpath = ;
private $content = ;
private $filename = ;
private $extname = .html;
public function createhtml($type,$desname,$content)
{
$this->htmlpath = getappinf(htmlpath);
if (!file_exists($this->htmlpath))
{
@mkdir($this->htmlpath);
}
$this->path = $this->htmlpath.$this->monthpath./;
if (!file_exists($this->path))
{
@mkdir($this->path);
}
$this->listpath = $this->htmlpath.list/;
if (!file_exists($this->listpath))
{
@mkdir($this->listpath);
}
switch ($type)
{
case index:
$this->filename = $desname;
break;
case list:
$this->filename = $this->listpath.$desname;
break;
case view:
$this->filename = $this->path.$desname;
break;
}
$this->filename .= $this->extname;
$this->content = $content;
}
public function write()
{
$fp=php教程($this->filename,wb);
if (!is_writable($this->filename))
{
return false;
}
if (!fwrite($fp,$this->content))
{
return false;
}
fclose($fp);
return $this->filename;
}
}
php自动采集内容中带有图片地址的远程图片保存到本地
php自动采集内容中带有图片地址的远程图片保存到本地
function my_file_get_contents($url, $timeout=30) {
if ( function_exists(curl_init) )
{
$ch = curl_init();
curl_setopt ($ch, curlopt_url, $url);
curl_setopt ($ch, curlopt_returntransfer, 1);
curl_setopt ($ch, curlopt_connecttimeout, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
}
else if ( ini_get(allow_url_fopen/ target=_blank >fopen) == 1 || strtolower(ini_get(allow_url_fopen)) == on )
{
$file_contents = @file_get_contents($url);
}
else
{
$file_contents = ;
}
return $file_contents;
}
php防dedecms附件式文件在线管理系统(1/6)
php教程防dedecms附件式文件在线管理系统
使用方法:
1。先在根目录建立uploadfile目录
2。“值”与“图”:这是用于将此图片传到父窗口的。值,传的是文件名,可用于input;图,传的是图片,用于编辑器。在使用此功能时,先将“值”前面的文本框填写父窗口的ID值。我在用层弹出本程序时可正常赋值。
3。可多个文件上传,如果目标目录有相同的文件,则重命名为“文件名(n).jpg",和FCKeditor一样的命名方式
测试环境:apache2.2.14 + PHP5.3 + windowswww.php100.com
*/
php ajax XMLHttpRequest POST实例代码
php教程 ajax XMLHttpRequest POST实例代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "php教程">
<html xmlns="php教程">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<head>
php fgetcsv读取csv文件代码(1/2)
php教程 fgetcsv读取csv文件代码
function get_csv_contents( $file_target ){
三种php汉字英文验证代码生成程序(1/4)
三种php教程汉字英文验证代码生成程序
php 生成word文档并下载代码
php教程 生成word文档并下载代码
include("include/conn_php教程.php");
$id=$_GET["id"];
$sql="select * from down where id=$id ";
$result=mysql_query($sql);
$row=mysql_fetch_row($result);
$file2=$row["upload"];
function downFile($sFilePath)
{
if(file_exists($sFilePath)){
$aFilePath=explode("/",str_replace("php教程);
$sFileName=$aFilePath[count($aFilePath)-1];
$nFileSize=filesize ($sFilePath);
header ("Content-Disposition: attachment; filename=" .basename($sFileName) );
header ("Content-Length: " . $nFileSize);
header ("Content-type: application/octet-stream");
mb_convert_encoding(readfile($sFilePath),"utf-8","GB2312");
}
else
{
echo("文件不存在!");
}
}
php图片上传代码
这是一款简单的php图片上传代码哦,如果你正在学习php,这是一款比较适合的东西。