preg_match() syntax issue
Posted: Mon Nov 24, 2008 9:20 am
Hello,
I'm trying to use preg_match() to locate the follow string which is defined as $match_expression.
When running the page I get the follow error: Warning: preg_match() [function.preg-match]: Unknown modifier '<'.
I need to know how to modify $match_expression to have preg_match() find what i'm looking for, but i'm confused on how I need to change the syntax.
Any help is greatly appreciated!
Thanks!
I'm trying to use preg_match() to locate the follow string which is defined as $match_expression.
Code: Select all
$total = file_get_contents('http://www.mywebsite.com');
$match_expression = '<td><a href="/(.*)\">';
preg_match($match_expression,$total,$matches);
I need to know how to modify $match_expression to have preg_match() find what i'm looking for, but i'm confused on how I need to change the syntax.
Any help is greatly appreciated!
Thanks!