Php regular expression to match a div
Posted
by Thoman
on Stack Overflow
See other posts from Stack Overflow
or by Thoman
Published on 2010-06-01T05:00:03Z
Indexed on
2010/06/01
5:03 UTC
Read the original article
Hit count: 209
preg-match-all
|regulation
Hello This is mycode
<?php
/**
* @author Joomlacoders
* @copyright 2010
*/
$url="http://urlchecker.net/html/demo.html";
$innerHtml=file_get_contents($url);
//echo $innerHtml;
preg_match_all("{\<div id='news-id-.*d'\>(.*)\</div\>}",$innerHtml,$matches);
//<div id='news-id-160346'>
var_dump($matches);
?>
I want find all content in div id='news-id-160346'. Please help me
© Stack Overflow or respective owner