So I want to turn the line after /r
completely red, but only this line.
So far I've got this (this only works because \n
gets replaced by <br>
earlier; it doesn't matter at the moment):
$str = preg_replace("/\/r(.*)<br>/", '<font color="red">$1</font><br>', $str);
This works so far, but only if there is really a line break. If you just type one line, it won't make it red.
Is there any way to get the end of a line, or the end of the whole text?
` in it? :) – Amal Murali Jul 28 '14 at 14:30