0
我該如何獲得包含以大寫字母和小寫字母開頭的單詞?因爲現在它只是小寫。Preg Replace中的小寫字母和大寫字母
感謝堆
$string = "you would love this @matt";
$pattern = '/(^|\W)(@([a-z]+))/';
$replacement = '$1<a href="/user/$3">$2</a>';
echo preg_replace($pattern, $replacement, $string);