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

php提取网页url


//获取 url
function match_links($document) {
preg_match_all("'<\s*a\s.*?href\s*=\s*([\"\'])?(?(1)(.*?)\\1|([^\s\>]+))[^>]*>?(.*?)</a>'isx",$document,$links);
while(list($key,$val) = each($links[2])) {
if(!empty($val))
$match[] = $val;
}
while(list($key,$val) = each($links[3])) {
if(!empty($val))
$match[] = $val;
}
return array($match,$links[4]);//返回一个数组,array(url数组,url文字数组)
}
本人一直在用的 php 提取 网页 url 函数。


相关文档:

PHP分页方法

$pagesize=10; //设置每一页显示的记录数
$c("localhost","root",""); //连接数据库
$rs=mysql_query("select count(*) from tb_product",$conn); //取得记录总数$rs
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];

Ɍ ......

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($inf ......

PHP安装配置

#./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-bz2 --with-curl - --with-curlwrappers --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --w ......

php字符串修改(处理)函数总结

声明(本文转载自):http://www.phpzc.com/read.php?tid=643
ltrim();//去掉字符串左空格;
rtrim();//去掉字符串右空格;
trim(); //去掉字符串两边空格;
         //去掉空格是返回一个新的字符串;原字符串不变;
strlen();     //计算字符串长度; ......

PHP 初识

以S2的BBS论坛项目作为整个基础课程的案例。
1.连接数据库和执行第一个SQL语句:
  1)PHP提供了连接数据库的函数--mysqli_connect(agrs0,agrs1,agrs3),我们直接使用就可以了。
    此函数包括三个必要的参数,分别为:localhost,数据库用户名,数据源。
     以bbs论坛连接My ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号