HTML内のURLを含む文字列があります。各URLにパラメータを追加したいのですが。
$my_string = "See our full range of <a href="http://www.mysite.com/cat.php?cPath=8" target="_blank">some category</a> online and also our popular <a href="http://www.mysite.com/product.php?products_id=22" target="_blank">some product</a>.";
最終的には次のようになります。
$my_new_string = "See our full range of <a href="http://www.mysite.com/cat.php?cPath=8&new_param=test" target="_blank">some category</a> online and also our popular <a href="http://www.mysite.com/product.php?products_id=22&new_param=test" target="_blank">some product</a>.";