I am trying to make the output have linebreaks between each line but it seems because my string contains a somewhat more complicated output eg "$matches['id']" I am unable to add the usual \n\r lines anywhere. I have tried numerous methods. Any suggestions? Should be simple
<?php
$file = file_get_contents('page.htm');
// -------- PROFILEs --------
preg_match_all('#<a.*?href="(?:http://)www.site.com/profiles/(?P<id>\d+)[^>]+#msi',$file, $matches);
$profiles = $matches['id'];
$uprofiles = array_unique($profiles);
echo '<pre>',print_r($uprofiles),'</pre>';
file_put_contents('Profile.txt', $uprofiles);
// ---------- IDs ----------
preg_match_all('#<a.*?href="(?:http://)www.site.com/id/(?P<id2>\w+)[^>]+#msi',$file, $matches2);
$ids = $matches2['id2'];
$uids = array_unique($ids);
echo '<pre>',print_r($uids),'</pre>';
file_put_contents('ID.txt', $uids);
?>
sorry for being an idiot, apparently I am missing something