<? function Text2Html($txt){ $txt = str_replace(" "," ",$txt); $txt = str_replace("<","<",$txt); $txt = str_replace(">",">",$txt); $txt = preg_replace("/[rn]{1,}/isU"," rn",$txt); return $txt; }
//把全角数字转为半角数字 <? function GetAlabNum($fnum){ $nums = array("0","1","2","3","4","5","6","7","8","9"); //OSPHP.com.CN $fnums = "0123456789"; for($i=0;$i<=9;$i++) $fnum = str_replace($nums[$i],$fnums[$i]
php /** * 常用静态类,这里主要整理了一些PHP常常会用到的方法。 */ class C { /* * 私有处理随机数的内置参数 * array 随机数数组/param 随机数长度 * 返回一个随机数
function pdf2png($PDF,$Path){ if(!extension_loaded('imagick')){ return false; } if(!file_exists($PDF)){ return false; } $IM = new imagick(); $IM->setResolution(120,120); $IM->setCompressionQuality(100
// $low and $high have to be integers function BinarySearch( $array, $key, $low, $high ) { if( $low > $high ) // termination case { return -1; } $middle = intval( ( $low+$high )/2 ); // gets the middl
对指定的关键词进行替换处理,在html页面上高亮显示 function highlight($sString, $aWords) { if (!is_array ($aWords) || empty ($aWords) || !is_string ($sString)) { return false; } $sWords = implode ('|', $aWords); return preg_
php $date1 = date( 'Y-m-d' ); $date2 = "2015-12-04"; $diff = abs(strtotime($date2) - strtotime($date1));
php // local file that should be send to the client $local_file = 'test-file.zip'; // filename that
curl_exec($ch); curl_close($ch); return $response; } 用法: php header("Content-type: image/png"); echo qr_code("http://koonk
php getValidate(100,30); function getValidate($w,$h){ $img = imagecreate($w,$h); $gray = imagecolorallocate($img
php /** * User: jifei * Date: 2013-07-30 * Time: 23:12 */ /** * PHP实现双向队列,双端队列 * 双端队列(deque,全名double-ended
php $array1 = array('OH','CA','NY','HI','CT'); $array2 = array('OH','CA','HI','NY','IA'); $array3 =
php passthru('ls', $return_val); echo 'Exit code of $return_val\n'; ?>
php class utf8_chinese { private $utf8_gb2312; private $utf8_big5; public function __construct(){ $this->utf8_gb2312
采用鸟哥的PHP的C扩展Yaf的实例案例演示 开放源代码 见下方 [PHP]代码 /** * 获得上传组件 * * @access public * @return void */ public function
项目中需要将表中的数据导出,在网上找了找发现phpexcel蛮好用的.特此分享 PHPEXCEL php if(!defined('BASEPATH')) exit('No direct script access
PHP并不限于创建HTML输出,它也可以被用来操作和创建各种不同的图片文件格式,包括GIF,PNG, JPEG, WBMP,和XPM。PHP可以将图像流直接输出至浏览器。 在这篇文章中,我们已经收
Web 开发世界里,PHP 是最流行的语言之一,从 PHP 里,你能够很容易的找到你所需的脚本,遗憾的是,很少人会去用“最佳做法”去写一个 PHP 程序。这里,我们向大家介绍 PHP 的 10 种最佳实
Secure and Pro PHP Framework Yii is one of the most popular and top Framework amongst all PHP Frameworks
PHP 5.6.10 发布,此版本修复了一些 bug,还有一些重要安全修复 (CVE-2015-3414, CVE-2015-3415, CVE-2015-3416, CVE-2015-2325 and