I am trying to get the Official Date and Time from an external URL and my PHP script does not return the values I want. Would you be so kind as to help me please?
<?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;
?>
The result I get simply is the following: hcentro: fcentro:
Nothing. Why? What am I doing wrong?
Please Help Me Guys