我正在尝试从以下位置获取字符串“hinsonlouann”:hinsonlouann当我运行以下命令时:$html="http://gisapps.co.union.nc.us/ws/rest/v2/cm_iw.ashx?gid=12339";$doc=newDOMDocument();$doc->loadHTMLFile($html);$xpath=newDOMXpath($doc);$elements=$xpath->query("*/div[@class='owner-name']");if(!is_null($elements)){foreach($elementsas$ele
$html=file_get_contents("http://www.somesite.com/");$dom=newDOMDocument();$dom->loadHTML($html);echo$dom;抛出Warning:DOMDocument::loadHTML():htmlParseEntityRef:expecting';'inEntity,Catchablefatalerror:ObjectofclassDOMDocumentcouldnotbeconvertedtostringintest.phponline10 最佳答案
$html=file_get_contents("http://www.somesite.com/");$dom=newDOMDocument();$dom->loadHTML($html);echo$dom;抛出Warning:DOMDocument::loadHTML():htmlParseEntityRef:expecting';'inEntity,Catchablefatalerror:ObjectofclassDOMDocumentcouldnotbeconvertedtostringintest.phponline10 最佳答案