Einzelnen Beitrag anzeigen
Alt 09.08.2004, 20:13   #4
Potassium
Inventar
 
Registriert seit: 06.03.2003
Alter: 37
Beiträge: 3.954

Mein Computer

Standard

PHP-Code:
if(substr_count(strtolower($text),"[url]") >= 1) {        
        if(!
substr_count(strtolower($text),"[url]http://www.") >= 1){
            
$text str_replace("[url]www.","[url]http://www.",$text);
        }
        
$text preg_replace("/\[url\](.*?)\[\/url\]/i","<a href=\"$1\">$1</a>"$text);        
    }
    if(
substr_count(strtolower($text),"[url=") >=1){        
        
$text str_replace("[url=www.","[url=http://www.",$text);        
        
$text preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/i","<a href=\"$1\">$2</a>"$text);

das wäre es in php
also [url][/ url]
und [url=blaba][/ url]
Potassium ist offline   Mit Zitat antworten