i tried that but i really don't know what i'm doing when it comes to regular expressions and it was a real mess
however i then found this preg_replace which is supposed to get the url (removing any commas after it etc) and insert into link tags
$str = " Consulats honoraires
Ajaccio : Hugues Schadegg. 8 cours Lucien Bonaparte. BP 815. 20192 Ajaccio cedex 4. Tél 04 95 21 28 43. Fax 04 95 51 27 37. consul.ch.corse@orange.fr Monaco : Urs Minder. http://www.google.com 10/12 Quai Antoine 1er. MC 98000 Monaco. Tel 00377 93 15 58 82. Fax 00377 93 15 58 11. urs.minder@ubs.com. Montpellier : Jean-Paul Aeschlimann. 66 Allée Mac Laren. 34000 Montpellier. Nice : Pierre Rudisuhli. Rés. St-Michel. 69 Av du Roi Albert. BP 280. 06405 Cannes.";
echo preg_replace('\b(https?|ftp|file|http)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]', '<a href="\0">\0</a>', $str);
trouble is, it gives me the following error
Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /home.10.26/revuesui/www/test-url.php on line 13
I don't know which delimiter it's referring to