How Can I load a specific DIV from an external webpage, into a specific DIV of my website?

柔情痞子 提交于 2019-12-01 01:51:25
<?php
   $url = "http://www.timeanddate.com/weather/";
   $page_all = file_get_contents($url); 

   preg_match('#<table class="border2 lpad wa">(.*)</table>#ms', $page_all, $div_array);


   echo "<pre>";
   print_r($div_array[0]);
   echo "</pre>";
?>

With the following CSS :

.wa {
    margin: 0 auto;
}

.border2 {
    background: none repeat scroll 0 0 #D7D6DC;
}

.lpad tr td {
    padding: 0.2em;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!