开发者

php: redirect()?

开发者 https://www.devze.com 2023-03-20 17:33 出处:网络
This is not a request for开发者_StackOverflow a solution, but just to clarify something. When I do a redirect in php I use header()

This is not a request for开发者_StackOverflow a solution, but just to clarify something.

When I do a redirect in php I use header()

but while going through someone else's class code I came across this:

 // Redirect to target
 redirect(proxifyURL($url, 'norefer'));

What the heck is that? And php does not seem to be throwing an error.

I tried looking it up by going to php.net/redirect but it shows me the header function that I usually use, not this redirect() !!??

Can someone explain this to me please?


It's probably a user-defined function. This means that the function isn't present in standard PHP, but that the author of the code you read made it himself.


He probably defined a new function that looks something like this

function redirect($to)
{
    header("Location: $to");
    die();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消