|
|
PHP Source code |
1 2 3 4 5 |
<?php
$text = "Dies ist ein Link, der ohne irgendwelche Tags umgewandelt werden soll: www.example.com test";
$text = preg_replace("/(((https?\:\/\/)|(www\.))[^\s]+)/", "<a href='\$1'>\$1</a>", $text);
echo $text;
?>
|
This post has been edited 4 times, last edit by "Funny" (Jul 19th 2011, 10:07pm)
|
|
Source code |
1 |
$text = preg_replace("/(((https?\:\/\/)|(www\.))[^\s]+[^\.\s]+)/", "<a href='\$1'>\$1</a>", $text);
|
This post has been edited 1 times, last edit by "Funny" (Dec 19th 2005, 4:45pm)
|
|
PHP Source code |
1 2 |
$text = preg_replace( '/(((http(s)?\:\/\/)|(www\.))([^\s]+[^\.\s]+))/', '<a href="http$4://$5$6">$1</a>',
$text);
|
Forum Software: Burning Board® 3.1.6, developed by WoltLab® GmbH