I'm my oddball quest to learn PHP, I've been working on simple applications (what better way to learn right?). So I find myself using preg_replace to convert usernames into links in posts using preg_replace. My hangup so far has been the whole regex .. I get it .. sort-of.
$var = preg_replace('/[!]+('.$value.')/',$shoutLink,$var); // $var = a post
The shoutlink is just a link to the members profile. Anyway, it works if the !username is on the first line of the input but when there are new lines without a space afterwords and another !username -- both fail to be replaced with the link. What gives? Does preg_replace see new lines as part of the input (\n!username) or does it ignore it?
LoL thanks ahead of time.