<?php
header('Content-type: text/plain; charset=utf-8');
error_reporting(0);
//////////////////////////////////////////
$urlParams = explode('/', $_SERVER['REQUEST_URI']);
$word = $urlParams[2];
$url = "http://www.oxfordlearnersdictionaries.com/definition/english/comfortable";
//////////////////////////////////////////
$dom = new DOMDocument;
$dom->loadHTMLFile($url);
$xpath = new DOMXPath($dom);
$qx = '//*[@class="pron-gs ei-g"]/span[@class="pron-g"]';
$nodes = $xpath->query($qx);
/* Set HTTP response header to plain text for debugging output */
header("Content-type: text/plain");
/* Traverse the DOMNodeList object to output each DomNode's nodeValue */
foreach ($nodes as $i => $node) {
echo "\n\n", "Node($i): ", $node->C14N(), "\n";
}
//*[@id="ceremony__10"]/span[2]
//*[@id="tab3"]/div/div[1]/strong/span
//$rqx5 = '//div[@class="tudich"]/div[@class="candich"]'; // tieu de co han tu
//$rqx5 = '//div[@class="tudich"]/div[@class="kqdich"]/div[@class="nddich"]/span'; // khong co han tu
//$rqx5 = '//div[@class="tudich"]/div[@class="kqdich"]/div[@class="nddich"]/strong[1]'; // nghia
//$result = array();
// foreach ($nodes as $i => $node) {
// $child = $xpath->query($rqx5, $node)->item(0);
// if (!empty($child)) {
// echo PHP_EOL . $i ." = ". $child->nodeValue;
// }
// else {
// echo PHP_EOL . $i ." = ". ":)";
// }
// }
?>
- Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
preferences:
202.54 ms | 404 KiB | 275 Q