If search and replace are arrays, then str_replace() takes a value from each array and uses them to do search and replace on subject . If replace has fewer values than search , then an empty string is used for the rest of replacement values. If search is an array and replace is a string, then this replacement string is used for every value of search . The converse would not make sense, though.
If search or replace are arrays, their elements are processed first to last.
(如果参数search和replace都是数组,那么str_replace()将对search和replace中的值一一对应进行对subject的替换。如果replace数组中值的个数比search少,那么剩余的值会默认为空值。(PS:如果replace数组中的值的个数比search多,多余的将被忽略。)
如果search是数组而且replace是一个字符串(String),那么替换的String将被用来进行search中所有的值的替换。尽管反过来是不行的。
如果search或者replace是数组,他们的值都是从头到尾的进行对应替换)
如果 HTTP 标头尚未被发送出去的话,headers_sent() 将返回 FALSE,否则返回 TRUE,通过header发送,否则通过meta标签跳转。
PHP中的跳转:(来自百度文库,有改动)
1、header()函数是PHP中进行页面跳转的一种十分简单的方法。header()函数的主要功能是将HTTP协议标头(header)输出到浏览器。
<?php
header("Location: http://www.baidu.com");
exit;//确保重定向后,后面的代码不会被执行
?>