Nitz Nitz - 7 months ago 10
PHP Question

Change the URL through PHP

I want to change the URL through PHP.

Something like

window.location.href = "http://www.something.com"
in JavaScript.

I want the same thing but in PHP. How can I do it?

Answer

You can use the header function for that:

header("LOCATION: http://www.something.com");