So, i'm making a proxy, cos, well, i'm bored. I thought it'd be rather easy actually.. but alas, it requires reg exp's - one of my pet hates; just below class's.
Anyway, the code im using:
[php]
$_string = file_get_conten ts("http://myspace.com"); // myspace file.
$_reg = '#\"http://(.*)\"#'; // regular expression
preg_match($_re g, $_string, $_match);
echo htmlentities($_ match[0]);
[/php]
This works... but it gives me this:
when what i actually want is:
It stretches to the last quote on the current line.. when i want the first quote that comes after href=
Any ideas?
Anyway, the code im using:
[php]
$_string = file_get_conten ts("http://myspace.com"); // myspace file.
$_reg = '#\"http://(.*)\"#'; // regular expression
preg_match($_re g, $_string, $_match);
echo htmlentities($_ match[0]);
[/php]
This works... but it gives me this:
Code:
"http://x.myspacecdn.com/Modules/Common/Static/img/iphone.png" /><meta http-equiv="expires" content="0" /><meta http-equiv="Pragma" content="no-cache"
Code:
"http://x.myspacecdn.com/Modules/Common/Static/img/iphone.png"
Any ideas?
Comment