<?php
use Zend\Dom\Query;
$query = new Query();
$query->registerXpathPhpFunctions();
$query->setDocument(file_get_contents('http://ugnews.net/'));
$result = $query->queryXpath('//title[php:functionString("preg_match", "/ugnews/i", node()) = 1]');
var_dump($result->current()->nodeValue);
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme