Hallo miteinandt,
ich habe ein kleines Problem und zwar geht es um dieses replace/pregexp zeug mit preg_replace, str_replace usw... ich komme damit irgendwie gar nicht klar.....
Also ich habe ein Array mit externen Links z.B.:
PHP-Code:
$link[0] = "http://www.google.de":
$link[1] = "http://www.yahoo.de";
$link[2] = "http://www.lycos.de";
$link[3] = "http://www.astalavista.de";
$link[4] = "http://mail.google.de";
$link[5] = "http://www.yahoo.de/bla/";
$link[6] = "http://www.yahoo.de/blong/";
Nun möchte ich, dass diese Links direkt in HTML umgewandelt werden und zwar so:
PHP-Code:
$link[0] = "<a href=\"http://www.google.de\">google (1)</a>"
$link[1] = "<a href=\"http://www.yahoo.de\">yahoo (1)</a>"
$link[2] = "<a href=\"http://www.lycos.de\">lycos (1)</a>"
$link[3] = "<a href=\"http://www.astalavista.de\">astalavista (1)</a>"
$link[4] = "<a href=\"http://mail.google.de\">Google (2)</a>"
$link[5] = "<a href=\"http://www.yahoo.de/bla/\">yahoo (2)</a>"
$link[6] = "<a href=\"http://www.yahoo.de/blong/\">yahoo (3)</a>"
Würde mich sehr über hilfreiche Antwortzen und Codes freuen, da ich replace leider gar nicht check'!
