个人站长制做网页常用的php代码

yipeiwu_com6年前PHP代码库
复制代码 代码如下:

<?php 
$str = file("http://tq.tom.com/china/index.html"); 
$count = count($str); 
for ($i=0;$i<$count;$i++){  
    $file .= $str[$i]; 

$tomtq = explode("<table width=\"774\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" bgcolor=\"#ABABAB\">",$file); 
$tomtq = explode("</table>",$tomtq[1]); 
$tomtq= $tomtq[0]; 
//$tomtq tom天气小偷 
?> 


天气预报 code来的





[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

相关文章

PHP引用的调用方法分析

本文实例讲述了PHP引用的调用方法。分享给大家供大家参考,具体如下: 示例1: function test($arr){} echo test(&$arr); 示例2:...

详解php中curl返回false的解决办法

首先来看一个封装的curl函数 function request_post($url = '', $param = '') { if (empty($url) || empty($...

PHP利用Socket获取网站的SSL证书与公钥

通过 php curl 请求网页并不能获取到证书信息,此时需要使用 ssl socket 获取证书内容。下面来一起看看看详细的介绍: 示例代码: // 创建 stream conte...

php的日期处理函数及uchome的function_coomon中日期处理函数的研究

复制代码 代码如下: <?php echo time(); echo mktime(11,25,0,9,5,2010);//和time一样的 echo microtime(); e...

解析php二分法查找数组是否包含某一元素

二分法查找数组是否包含某一元素,兼容正反序,代码实现:复制代码 代码如下:<?php $searchValue = (int)$_GET['key']; fun...