易截截图软件、单文件、免安装、纯绿色、仅160KB

php 截取utf 8字符串

找了很多这样的函数,还是觉的这个最好了
$a = 'aadfdsf夺顶替一枯基22245顶替sdffh压下';
/**
* 截取utf-8字符
* @param string $string
* @param int$length
*
* return string
*/
function cutstr($string, $length) {
preg_match_all("/./u", $string, $info);
$i = 0;
$str = '';
foreach($info[0] as $item){
if(strlen($item) == 3){
$i+=2;
}else{
$i++;
}
$str .= $item;
if($i>=$length)break;
}
return $str;
}
echo cutstr($a, 10); //-> aadfdsf夺顶 


相关文档:

php开发50个非常有用的工具【转】

这里50个有益的PHP工具,可以大大提高你的编程工作:
调试工具
Webgrind
Xdebug
Gubed PHP Debugger
DBG
PHP_Debug
PHP_Dyn
MacGDBp
测试和优化工具
PHPUnit
SimpleTest
Selenium
PHP_CodeSniffer
dBug
PHP Profile Class
文档工具
phpDocumentor
PHP DOX
安全工具
Securimage
:验证码工具。
Scave ......

windows2003+iis6+php+mysql 服务器配置

在网上看了很多关于windows2003+iis6+php+mysql 服务器配置的文章,大体上都是互相抄袭,不过一些公共的信息还是很正确的,但是针对一些特别的机器或者因为个人不同的配置总不能按照文章的内容操作成功,下面说一种较为简单的操作方法,步骤如下:
1.iis安装(略)
2.下载AppServ并安装
3.在c:\建php5文件夹,然后再php5 ......

mysql+php无法连接sql(已解决)

搞了很久。。终于发现原来是权限问题。。
2行命令搞定
grant all privileges on rogue.* to admin@localhost identified by 'admin' with grant option
grant all privileges on rogue.* to admin@'%' identified by 'admin' with grant option
经典了。。。
魔力私服网页端搞定咯~~ ......

PHP连接MYSQL数据库

<p>04级新生名单</p>
<table border="1" width="80%" cellpadding="0">
<tr>
<td width="10%" align="center">Id</td>
<td width="20%" align="center">Name</td>
<td width="10%" align="center">Age</td>
<td width="10%" align="cent ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号