Preg_replace or preg_replace_callback?
问题 I have links on some pages that use an old system such as: <a href='/app/?query=stuff_is_here'>This is a link</a> They need to be converted to the new system which is like: <a href='/newapp/?q=stuff+is+here'>This is a link</a> I can use preg_replace t0 change some of what i need to, but i also need to replace underscores in the query with +'s instead. My current code is: //$content is the page html $content = preg_replace('#(href)="http://www.site.com/app/?query=([^:"]*)(?:")#','$1="http:/