I am modifying a script to output a string from a long page of text and this works like a charm, the only issue is that the second set will only output numbers.
<?php
$file = file_get_contents('page.htm');
preg_match_all('#<a.*?href="(?:http://)www.site.com/profiles/(?P<id>\d+)[^>]+#msi',$file, $matches);
$f = fopen("file.txt", "w");
print_r($matches['id']);
fwrite($f, print_r($matches['id'], true));
fclose($f);
echo "<br><br>";
preg_match_all('#<a.*?href="(?:http://)www.site.com/id/(?P<id2>\d+)[^>]+#msi',$file, $matches2);
$f = fopen("file.txt", "w");
print_r($matches2['id2']);
fwrite($f, print_r($matches2['id2'], true));
fclose($f);
?>
The top one is supposed to do that, but the bottom one needs to allow ALL characters including special ones, is there something missing or something I need to add? Thanks a ton!