preg match - PHP get div that contains a word -


i'm trying divs contain [release] @ bottom of page http://mpgh.net/forum/175-crossfire-hacks-cheats/.

<?php $text = file_get_contents("http://mpgh.net/forum/175-crossfire-hacks-cheats/");  $check_hash = preg_match('#<div class=\"inner\"> <h3 class=\"threadtitle\"> <a href="\.*?\" id=\".*?\"><img class=\".*?\" src=\".*?\" alt=\"go first new post\" title=\"go first new post\"></a> <img src=\".*?\" alt=\".*?\" border=\"0\" title=\".*?\"> <span class=\"prefix understate\"> <span style=\".*?\"><b>(.*?)</b></span> </span> <a class=\"title threadtitle_unread\" href=\"(.*?)\" id=\".*?\">(.*?)</a> </h3> <div class=\"threadmeta\"> <div class=\"author\"> <span class=\"label\">started by&nbsp;<a rel=\"nofollow\" href=\"(.*?)\" class=\"username understate\" title=\"started (.*?) on .*?\">.*?</a>.*?</span> </div> </div> </div>#', $text, $match);  print_r($match); 

i tried doesn't work, i'm confused because can't find solution this.

thanks.

use simple html dom:
try code:

require_once('simple_html_dom.php'); $html = file_get_html('http://mpgh.net/forum/175-crossfire-hacks-cheats/'); $ret = $html->find('div[class=inner]',0); echo $ret->innertext; 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -