1
I'm trying automate internal links within pages on my website. I need already linked text to be exempted.PHP匹配短語只有在以外<a href> tag
For the following example it should only replace the bolded text (Example).
<a class="Example" href="http://www.example.com/">Example</a>
<p>New **Example**</p>
I tried the following but it didn't work.
$re = '/(\b'.$search.'\b)+((?=.*<a)|(?!.*<\/a>))/';
$str=preg_replace($re, $replace, $text);
請格式化您的問題,這是沒有意義的,因爲它是 – mayersdesign
歡迎來到堆棧溢出! [義務鏈接](http://stackoverflow.com/a/1732454/2307070)關於爲什麼ṫ̨̗̺̭̮̞̗̜̮̗̙̫̺̖̭̯͊ͨ̌͒̍͘͘͟͝h̸͓̩̙͙̻̗͔̞̘̟̩̯͋͑͐a̴̧ͨͭ͒ͯ̓͐̇ͥ͢҉̨̳̜̤͍͖t̵̳̳͕͉͋̓͐ͦͬ̈̚是一個壞主意 –