【发布时间】:2015-08-26 10:02:08
【问题描述】:
我将此网址返回到数组中
$imagelink = $_SERVER['SERVER_NAME'] ."/test/wp-content/plugins/test/captcha/" .$captchaURL.".jpeg";
当我 return $imagelink; 在我的一个数组中时,它会显示:
“图片网址”:“localhost/test/wp-content/plugins/test/captcha/LTgLUodmPu.jpeg”
我尝试替换 /
$imagelink = $_SERVER['SERVER_NAME'] ."/test/wp-content/plugins/test/captcha/" .$captchaURL.".jpeg";
$replace = str_replace('\/','/',$imagelink);
return $replace;
结果还是一样?它似乎没有取代。为什么? 它与我也使用 preg_replace() 函数相同。
如果你有答案,请帮忙。
【问题讨论】:
-
用你要替换的东西?
-
用
/替换/???
标签: php url preg-replace str-replace