0
如何用php替換url 爲什麼這段代碼不起作用。 請幫助如何用php替換url
$mylogo = 'http://example.com/images/logo.png';
$inputmylogo = 'http://example.com/image.png';
$file = 'setting.php';
$content = file_get_contents($file);
var_dump(preg_replace('/'.$mylogo.'/', $inputmylogo, $content));
使用'str_replace()函數'參考http://php.net/manual/en/function.str-replace.php –