Anyone see whats wrong with this: http://pastebin.com/m1c0d37fe I thought it'd pick a correct match but I'm getting an error...? Error is: Warning: preg_match() [function.preg-match]: Unknown modifier ' ' in /home/donku/public_html/script.php on line 37
I thought it'd be quite easy to see what I wanna do... Basically, I've got the file_get_contents and I wanna check if $pattern is in it?
Yeah, I looked at strpos but I eventually want to use regex so it grabs everything in that format. E.G # <div class="item"> # <div> # <!-- # <a href="massive_bike_race_pileup" target="_new"> # <img src="http://204.14.123.30/content/thumb/d112008/massive_bike_race_pileup.jpg" alt="Massive Bike Race Pileup" width="120" height="100" class="thumb" border=0 /> # # </a> # --> # <a href="/videos/massive_bike_race_pileup.html" > # <img src="http://204.14.123.30/content/thumb/d112008/massive_bike_race_pileup.jpg" alt="Massive Bike Race Pileup" width="120" height="100" class="thumb" border=0 /> # # </a> # </div> # # <h2> <a href="/videos/massive_bike_race_pileup.html" >Massive Bike Race Pileup</a> # # </h2> # Rate: Not rated | Votes: 0 <br /> # Viewed: 1367 | Added: 01/01/2008 19:45<br /> # Category: # # Video # # <br /> # <br /> # # Now THAT makes for an interesting bike race!<br /><br /> # # <!-- # <strong>Channel:</strong> <a href="#">Video » Funny Video</a> # --> # </div> Code (markup): So I grab the thumbnail url, description & title etc.
HI, The issue is your pattern is invalid. A pattern should be a regex of what you are looking for. http://uk3.php.net/preg_match Take a look at how the 1st example is done. You could adapt that for what you need.