Remove parameters from url in PHP

In case you have a url and you want to remove all parameters from it use this:

This regex directive means – replace everything in the string coming after “?” with nothing.

Leave a Reply

Your email address will not be published. Required fields are marked *