PHP-Code:
$text = "http://www.php.de";
if(preg_match("[http://]", $text))
{
echo '<a href=' . $text. '>Link</a>';
}
PHP-Code:
$text = "Eine Weiterleitung zu http://www.php.de";
if(preg_match("[http://]", $text))
{
echo '<a href=' . $text. '>Link</a>';
}
Gibt es eine Möglichkeit, dass im Text ausschließlich der Link formatiert, der restliche Text aber in Ruhe gelassen wird?
Einen Kommentar schreiben: