我想從以下字符串刪除特殊字符@
從一個字符串中刪除特殊字符
$string="Test <a href='/group/profile/1'>@Test User</a> another test <a href='/group/profile/2'>@User Test</a>";
預期輸出:
<a href='/group/profile/1'>Test User</a> another test <a href='/group/profile/2'>User Test</a>"
在這裏,我需要檢查每一個錨標籤字符串中和只需要找到帶有href中的word profile的錨標籤,並且需要從鏈接文本中刪除@
。如果字符串中的錨標籤外部有任何@
,則不應刪除它,只有anc中的@
hor標記需要刪除。
輸出缺少前導' 「測試」'以及;預期? –