0
我想从外部URL获取官方日期和时间,并且我的PHP脚本不会返回我想要的值。你会那么好心帮我吗?从外部URL获取官方日期和时间
<?php
// example of how to use basic selector to retrieve HTML contents
require_once('simplehtmldom/simple_html_dom.php');
// get DOM from URL or file
$html = file_get_html('http://www.cenam.mx/hora_oficial/');
// get and show the Mexico Center's Time
$hcentro = $html->find('div[id=hcentro]', 0)->innertext;
echo 'hcentro: '. $hcentro;
// get and show the Mexico Center's Date
$fcentro = $html->find('div[id=fcentro]', 0)->innertext;
echo 'fcentro: '. $fcentro;
?>
结果我得到的仅仅是: hcentro:fcentro:
没有。为什么?我究竟做错了什么?
请帮我家伙
感谢的LAUR伊万时,奇怪的是,使用VB6,我能得到的时间和与htmlDom对象外部URL的日期。 –