I am using wordwrap function to wrap long words
$message = wordwrap($message, 40, ' ', 1);
The problem is that this function wraps everything, including URLs. Is there any way how to use this function so that it leaves URLs as they are?
Thanks.
Get rid of the last argument (the "1") or set it to 0/false if you don't want "words" longer than specified line length to be split.