我想在 xml 文件中替换服务器的地址。在线放置占位符%scr_path%
。
<property id="urlGenerateImage">%scr_path%/imgcap.php</property>
使用以下代码
$path=$wsurl."core/contents/tests";
//read the entire string
$str=implode("\n",file('../includes/ckeditor/plugins/fmath_formula/dialogs/configMathMLEditor.xml'));
$fp=fopen('../includes/ckeditor/plugins/fmath_formula/dialogs/configMathMLEditor.xml','w');
//replace something in the file string
$str=str_replace('%scr_path%',$path,$str);
//now, TOTALLY rewrite the file
fwrite($fp,$str,strlen($str));
得到一堆关于错误文件路径的错误。检查了两次路径。怎么了?