jeddi
11-04-2009, 12:12 PM
Hi,
I am using this expression to pick up the url from my document:
preg_match("/href=\"(.*?)\"/",$text,$matches, PREG_OFFSET_CAPTURE);
When I print the array with:
print_r($matches);
I get this:
Array ( [0] => Array ( [0] => href="http://sbinfocanada.about.com/od/salesselling/a/increasesales.htm" [1] => 55 ) [1] => Array ( [0] => http://sbinfocanada.about.com/od/salesselling/a/increasesales.htm [1] => 61 ) )
How do I pick up this bit "http://sbinfocanada.about.com/od/salesselling/a/increasesales.htm " ?
i.e. $saved_url = $matches[ ??
I tried various combinations like:
echo "<br><br><br>Match: $matches['1[0]']";
but without success :confused:
I am using this expression to pick up the url from my document:
preg_match("/href=\"(.*?)\"/",$text,$matches, PREG_OFFSET_CAPTURE);
When I print the array with:
print_r($matches);
I get this:
Array ( [0] => Array ( [0] => href="http://sbinfocanada.about.com/od/salesselling/a/increasesales.htm" [1] => 55 ) [1] => Array ( [0] => http://sbinfocanada.about.com/od/salesselling/a/increasesales.htm [1] => 61 ) )
How do I pick up this bit "http://sbinfocanada.about.com/od/salesselling/a/increasesales.htm " ?
i.e. $saved_url = $matches[ ??
I tried various combinations like:
echo "<br><br><br>Match: $matches['1[0]']";
but without success :confused: