Home > Backend Development > PHP Tutorial > str_replace这句话有什么问题呢。

str_replace这句话有什么问题呢。

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 14:13:06
Original
1038 people have browsed it

$url=str_replace("../crm","fkzdy",$url);这句话有什么错误吗?


回复讨论(解决方案)

没有错误!你遇到了什么问题?

没有错误!你遇到了什么问题? $url里面有../crm,我想替换掉,没起作用。

$url = '../crm/xxx';$url = str_replace("../crm","fkzdy",$url);echo $url;
Copy after login
fkzdy/xxx

$url=str_replace("../crm","fkzdy",$url);这句话有什么错误吗?

这一句本身是没有错误的,但有一点要注意,如果$url是直接从地址栏获取URL的,那你的URL中的“../crm”有没有被解析?

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template