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

yipeiwu_com5年前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需刷新才能执行]

相关文章

深入for,while,foreach遍历时间比较的详解

这个是从别人空间里看来的,不过自己还真从来没这么做过他们三者之间的比较,今天也学习了一下。复制代码 代码如下:<?php$arr = array();for($i = 0; $i...

基于php split()函数的用法详解

PHP函数split()的基本语法为:array split ( string $pattern, string $string [, int $limit] )。我们向大家举了两个例子...

PHP的面试题集,附我的答案和分析(一)

面试题1 1、用PHP打印出前一天的时间格式是2006-5-10 22:21:21 2、echo(),print(),print_r()的区别 3、能够使HTML和PHP分离开...

GBK的页面输出JSON格式的php函数

复制代码 代码如下:function tb_json_encode($value, $options = 0) { return json_encode(tb_json_convert_...

关于crontab的使用详解

使用crontab定时执行php代码,例  每隔十分钟执行一次:/10 * * * * wget -q --sqider http://******一、在Crontab中使用P...