php后端对跳转的封装
/** * 页面跳转 * $url 跳转地址 * $time 一段时间后跳转 */ function app_redirect($url,$time=0,$msg='') { //多行URL地址支持 $url = str_replace(array("\n", "\r"), '', $url); if (!headers_sent()) { // redirect if(0===$time&&$msg=="") { if(substr($url,0,1)=="/") { if(defined("SITE_DOMAIN")) header("Location:".SITE_DOMAIN.$url); else header("Location:".$url); } else { header("Location:".$url); } }else { header("refresh:{$time};url={$url}"); //$time 后跳转 echo($msg); } exit(); }else { $str = "<meta http-equiv='Refresh' content='{$time};URL={$url}'>"; if($time!=0) $str .= $msg; exit($str); } }
相关推荐
-
mail.php php
2019-1-7
-
PHP中中文转拼音 php
2019-1-8
-
git常见命令 php
2019-1-8
-
php的FTP操作类 php
2019-1-7
-
数字转人民币金额大写 php
2019-1-7
-
获取小程序码 php
2019-1-7
-
微信浏览器中如何使用支付宝支付 php
2019-1-7
-
curl抓取数据 php
2019-1-7
-
PHP 加密函数 php
2019-1-13
-
php数字转化为人民币大写 php
2019-1-8