
php
iteye_12449
这个作者很懒,什么都没留下…
展开
-
获取<meta>中的content标签内容
php函数:$tags = get_meta_tags ( 'http://shop.icbuy.com/' ); echo $tags [ 'author' ]; // name echo $tags [ 'keywords' ]; // php documentation echo $tags [ 'description' ]; // a php manual echo $tags [ ...原创 2012-02-24 09:04:57 · 1687 阅读 · 0 评论 -
cookie和会话(二)
会话 除了能够在客户机和服务器之间发送少量信息外,还允许跟踪用户在WEB应用程序中操作的进程这就是其特性。会话要使用会话cookie(过期时间设置为0的cookie),并且将一个称谓会话ID的唯一标示符与用户关联起来。1:基本用法在想要激活会员的脚本在接近开头的地方调用session_start函数来启动会话。 session_start();if(isset($_SES...原创 2012-12-07 23:34:44 · 130 阅读 · 0 评论 -
cookie和会话(三)
1:如何传输会话ID会话ID在cookie中发送,cookie的名字就是会话名,在下一次调用session_start时,php会从这个cookie获得会话ID,并检查与给定相关联的会话程序存贮,如果没有得到数据,就创建一个新的数据集。但是,一些用户将浏览器配置为不接受cookie。如果会话机制完全依赖于cookie,那么这就有问题了。php对此有个方案,当它探测到不能使用cookie时,它可...原创 2012-12-10 22:30:05 · 128 阅读 · 0 评论 -
实时编辑表格
实时编辑表格原创 2014-06-03 10:08:46 · 205 阅读 · 0 评论 -
PHP的位运算
$a & $b and(按位与)$a | $b or(按位或)$a ^ $b Xor(按位异或)~$a Not(按位非)$a << $b Shift left(左移)$a >> $b Shift right(右移)详解$a & $b 按位与 把$a和$b中都为1的位设为1;例:10 & 12 = 810 101...原创 2013-01-09 10:34:57 · 93 阅读 · 0 评论 -
php oracle CLOB
1.php insert oracle 的CLOB字段$sql = "INSERT INTO NC57.lsdcu_callreport(pk_cu_callreport,pk_cumandoc,evaluate,visittype,ansales,anpurchases,visitdate,creator,createtime,pk_dept,visitpurpose,customadd...原创 2013-03-05 10:49:27 · 241 阅读 · 0 评论 -
格式化文件大小
function formatBytes($bytes) { if($bytes >= 1073741824) { $bytes = round($bytes / 1073741824 * 100) / 100 . 'GB'; } elseif($bytes >= 1048576) { $bytes = round($bytes / 1048576 * 100) / 100 ....原创 2013-04-09 15:41:06 · 159 阅读 · 0 评论 -
PHP显示Deprecated: Assigning the return value of new by reference is deprecated in
昨晚用Spreadsheet_Excel_Reader导入EXCEL内容到数据库的时候,出现了以下提示:Deprecated: Assigning the return value of new by reference is deprecated in定位到出错的那一行:$this->_ole =& new OLERead();我本地环境用的是...原创 2013-04-09 15:41:53 · 103 阅读 · 0 评论 -
ckeditor配置
// 界面语言,默认为 'en'config.language = 'zh-cn';// 设置宽高config.width = 400;config.height = 400;// 编辑器样式,有三种:'kama'(默认)、'office2003'、'v2'config.skin = 'v2';// 背景颜色config.uiColor = '#FFF';// 工具栏(基础'Basic'、全能...原创 2013-04-09 15:42:24 · 131 阅读 · 0 评论 -
cookie和会话(一)
cookie解决了跟踪各个访问者或用户,服务器利用cookie这种机制将少量的信息随着响应发送到客户机。这些信息由名称和值组成,都是最为文本字符串发送的。当客户机对服务器发送的另一个请求时,它将从这个服务器收到的任何cookie随着新的请求一起发送回去。1:基本操作------ 设置和访问cookie1> 设置: setcookie(cookie_name,cooki...原创 2012-12-05 23:04:18 · 128 阅读 · 0 评论 -
(转)匹配中文
在javascript中,要判断字符串是中文是很简单的。比如:var str = "php编程";if (/^[\u4e00-\u9fa5]+$/.test(str)) {alert("该字符串全部是中文");} else {alert("该字符串不全部是中文");}想当然的,在php中来判断字符串是否为中文,就会沿袭这个思路:<?php$str = "php编程";if ...原创 2012-11-27 17:13:57 · 302 阅读 · 0 评论 -
php+jquery+ajax+json简单小例子
直接贴代码:<html><title>php+jquery+ajax+json简单小例子</title><?phpheader("Content-Type:text/html;charset=utf-8");?><head><script type="text/javascript" s原创 2012-11-22 23:52:41 · 245 阅读 · 0 评论 -
PHP中的几个字符函数
下面小结PHP中的几个字符函数,小结一下: 1)ucfirst 将首字母变大写,比如 $string = "this is my web development blog"; echo ucfirst($string); // Output: This is my web development blog 2) lcfirst,将首字母变小写 $string = "This i...原创 2011-11-07 21:20:28 · 127 阅读 · 0 评论 -
(转)PHP正则提取图片img标记中的任意属性修改
/*PHP正则提取图片img标记中的任意属性*/$str = '<center><img src="/uploads/images/20100516000.jpg" height="120" width="120"><br />PHP正则提取或更改图片img标记中的任意属性</center>';//1、取整个图片代码preg_match(原创 2011-11-15 23:24:45 · 426 阅读 · 0 评论 -
PHP获取类名及所有函数名
PHP获取类名及所有函数名1.获取行号、文件路径文件名、类名、方法名的常量__LINE__ 文件中的当前行号。__FILE__ 文件的完整路径和文件名。如果用在包含文件中,则返回包含文件名。自 PHP 4.0.2 起,__FILE__ 总是包含一个绝对路径,而在此之前的版本有时会包含一个相对路径。__FUNCTION__ 函数名称(PHP 4.3.0 新加)。自 P...原创 2012-08-24 11:48:09 · 178 阅读 · 0 评论 -
匹配链接
有一段类似下面的代码,匹配所有的链接地址:$code = '<li><a target="_blank" href="http://www.taobao.com/" style="width:100px;height:100px;background:#FF0000;display:block;"><a href="http://www.taobao.com/&qu原创 2012-10-30 11:43:37 · 171 阅读 · 0 评论 -
检查浏览器版本类
class BrowserDetector {var $UA = ""; //$HTTP_USER_AGENT的内容var $BROWSER= "Unknown"; //浏览器类型var $PLATFORM = "Unknown"; //操作系统var $VERSION= ""; //浏览器版本号var $MAJORVER = ""; //浏览器主版本号var $MINOR...原创 2012-11-09 13:11:34 · 78 阅读 · 0 评论 -
html2fpdf HTML转换为PDF
下载html2fpdf包:downurl:http://sourceforge.net/projects/html2fpdf/测试下:require('html2fpdf.php');$pdf=new HTML2FPDF();$pdf->AddPage();$fp = fopen("sample.hml","r");$strContent = fread($fp, filesiz...原创 2012-11-14 12:33:21 · 995 阅读 · 1 评论 -
几个经典函数
1:是否为邮件 function is_email($email) { return strlen ( $email ) > 6 && preg_match ( "/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/", $email ); }2:是否是手机号 function is_mobile($mobile) { return preg_match...原创 2012-11-20 00:19:24 · 201 阅读 · 0 评论 -
PECR
经常使用的分隔符是正斜线(/), hash符号(#) 以及取反符号(~). 下面的例子都是使用合法分隔符的模式. /foo bar/#^[^0-9]$#+php+%[a-zA-Z0-9_-]%\a 响铃字符(十六进制07) \cx "control-x", x是任意字符 \e 转义 (十六进制 1B)...原创 2012-11-20 22:13:36 · 234 阅读 · 0 评论 -
操作字符串
strpos() - Find the position of the first occurrence of a substring in a stringstripos() - Find the position of the first occurrence of a case-insensitive substring in a stringstrripos() - Find...原创 2013-04-09 15:42:39 · 111 阅读 · 0 评论