Record a fully functional PHP jump function

Source: Internet
Author: User

PHP redirection, that is, redirecting a browser to a specified URL, is a common function. This feature also has some detailed requirements, such as the number of seconds to wait for the jump, the use of JavaScript to achieve the jump, and so on. The following jump method takes into account a lot of parameters and can be used in specific projects.

<? Php/*** redirect the browser to the specified URL ** @ param string $ url the url to be redirected * @ param int $ how many seconds after delay waits * @ param bool $ js indication whether to return the JavaScript code for redirect * @ param bool $ jsWrapped indicates whether to use <mce: script type = "text/javascript"> <! -- Label for packaging * @ param bool $ return indicates whether to return the generated JavaScript code */function redirect ($ url, $ delay = 0, $ js = false, $ jsWrapped = true, $ return = false) {$ delay = (int) $ delay; if (! $ Js) {if (headers_sent () | $ delay> 0) {echo <EOT 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.