I am trying to make a php script to output all values inside an hypehref=" ** " from a text file.
I'm having a hard time with the regular expression part.
This is what I have
$Vdata = file_get_contents('file.txt');
preg_match( '/hyperef="(.*?)"/', $Vdata, $match );
echo '<pre>'; print_r($match); echo '</pre>'
My result is this :
Array
(
[0] => hyperef="http://lookbook.nu/look/5709720-Choies-Silvery-Bag-Rosewholesale-Punk-Style/hype"
[1] => http://lookbook.nu/look/5709720-Choies-Silvery-Bag-Rosewholesale-Punk-Style/hype
)
The [0] is incorrect, it includes the part I am searching for... all I want is the result after the hypehref="
The second result [1] is correct
and my file should have given me about 10 results.. not just 2...
Any ideas why ? Thx
preg_match_alland check the manual...