Question

maintenant j'ai un problème eregi_replace:

j'ai ceci

$subject = "This is for @codeworxx - you have to try first!";
$text = eregi_replace('(((@))[-a-zA-Z0-9]+)','<a href="http://www.google.de/\\1">\\1</a>', $subject);
echo $text;

Tout fonctionne bien, mais le

<a href="http://www.google.com/@codeworxx">@codeworxx</a>

mais je veux celui-ci:

<a href="http://www.google.com/codeworxx">codeworxx</a>

comment faire?

Merci, Sascha

Était-ce utile?

La solution

<?php
$subject = "This is for @codeworxx - you have to try first!";
$text = eregi_replace('@([-a-zA-Z0-9]+)','<a href="http://www.google.de/\\1">\\1</a>', $subject);
echo $text;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top