Operator_Jon
Erfahrenes Mitglied
HI!
Ich suche noch ein str_replace um Urls umzuwandeln!
sagen wir jemand schreibt in den text:
Code Info
das soll er dann um wandeln in:
<a href="code_info.php">Code Info</a>
ich habe es bis jetzt erfolglos mit folgendem probiert:
Die Javascript Funktion:
und der PHP replace dazu(wie gesagt erfolglos!!!):
hoffe mir kann da jemand helfen, thx
cu
OP_Jon
Ich suche noch ein str_replace um Urls umzuwandeln!
sagen wir jemand schreibt in den text:
Code Info
das soll er dann um wandeln in:
<a href="code_info.php">Code Info</a>
ich habe es bis jetzt erfolglos mit folgendem probiert:
Die Javascript Funktion:
Code:
#
var page;
function url(page)
{
var win=window.open(page,"Opened URL","width=640,height=480,location=yes,menubar=yes,resizable=yes,status=yes,scrollbars=yes");
}
PHP:
function replace_urls($value) {
$value = str_replace("[ URL=","<a href=\"javascript:url('",$value);
$value = str_replace(" /]","')\"",$value);
$value = str_replace("[ /URL]","</a>",$value);
return $value;
}
$text = "[ URL=code_info.php /]Code Info[ /URL]";
$text = replace_urls($text);
echo $text;
cu
OP_Jon