PHP get external page content
问题 i get the html from another site with file_get_contens , my question is how can i get a specific tag value? let's say i have: <div id="global"><p class="paragraph">1800</p></div> how can i get paragraph's value? thanks 回答1: If the example is really that trivial you could just use a regular expression. For generic HTML parsing though, PHP has DOM support: $dom = new domDocument(); $dom->loadHTML("<div id=\"global\"><p class=\"paragraph\">1800</p></div>"); echo $dom->getElementsByTagName('p')-