现在我有一个eregi_replace问题:
我有这个
$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;
一切都很好,但是
<a href="http://www.google.com/@codeworxx">@codeworxx</a>
但我想要这个:
<a href="http://www.google.com/codeworxx">codeworxx</a>
怎么办?
谢谢, 的Sascha
答案 0 :(得分:2)
<?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;