I'm trying to get all the data within the title attribute of an anchor tag

heres what ive tried and it just doesnt work:

<?php

$data = file_get_contents("alt.txt");
preg_match('/title="(.*)"/sim',$data,$matches);
echo "<pre>";
print_r($matches);
echo "</pre>";

?>

thanks

    got it... had to add U to make it ungreedy

    <?php
    
    $data = file_get_contents("alt.txt");
    preg_match_all('/title="(.*)"/simU',$data,$matches);
    
    echo "<pre>";
    print_r($matches);
    echo "</pre>";
    
    ?>
    
      Write a Reply...