0

I am trying to convert user's posts (text) into hashtag clickable links, using PHP.

my code is

$string = 'testing text #tag1 testing text #tag2'
$ur =   $myurl;
$description=preg_replace('/#(\\w+)/','<a href='.$ur.'/$1>$0</a>',$string);

its work great when post is in English but its fail when user post in Chinese language

How can above work on Chinese language.

Thanks

Rich5757
  • 155
  • 2
  • 12

0 Answers0