![]() |
Regular Expression help PREG_REPLACE()
Hello
I need to do a fast replace using preg_replace on php. The syntax is: Everything inside a html href tag "&" with a "#" So, the html code: <a href="https://gfy.com/link/blah&g">link &</a> would go to <a href="https://gfy.com/link/blah#g">link &</a> Only replacing the & inside html. thank you |
PHP Code:
|
should do the job allright
|
preg_replace("\&","#","<a href=\"https://gfy.com/link/blah&g\">link &</a>");
This should work man. Try it out ;) |
Yes, but I do NOT want to replace anything else than what's inside the href.
|
All times are GMT -7. The time now is 04:54 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123