||02-23-2009 11:35 AM
$domain = "http://twitter.com/paulor";
$ch = curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data1=curl_exec($ch) or die(curl_error());
$regex = '/<span id="following_count" class="stats_count numeric">(.+?)</span>"/';
Getting this error:
Warning: preg_match() [function.preg-match]: Unknown modifier 'p' on line 15
line 15 is the regex btw
anyone know whats wrong?
||02-23-2009 11:50 AM
The regex pattern contains the string
</span>. Since your delimiter is the forward slash, the pattern parser tries to stop read a pattern at the second forward slash which in this case is actually part of the closing span tag and not really the end of your pattern! Since the parser thinks the pattern has ended at that forward slash, it starts looking for modifiers.
s is a valid one (which is why no error is raised there) but
1. Use a different delimiter which won't be used in your pattern (popularly tilde
2. Escape the delimiter in your pattern:
||02-23-2009 11:52 AM
thank you sir!
|All times are GMT. The time now is 07:48 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0