PHPePub\Core\EPub::findIdAttributes PHP Method

findIdAttributes() public method

find all id attributes in the html document.
public findIdAttributes ( string $chapterData ) : array
$chapterData string
return array
    function findIdAttributes($chapterData)
    {
        $xmlDoc = new DOMDocument();
        @$xmlDoc->loadHTML($chapterData);
        $xpath = new DomXpath($xmlDoc);
        $rv = array();
        // traverse all results
        foreach ($xpath->query('//@id') as $rowNode) {
            $rv[] = $rowNode->nodeValue;
        }
        return $rv;
    }