【发布时间】:2014-08-23 23:51:04
【问题描述】:
我的文件夹中有文件(index.html),这些文件包含以下代码
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
</head>
<body>
<script type="text/javascript" src="/wp-content/themes/twentyfourteen/open.js"></script>
</body>
</html>
我希望脚本 php 寻找此代码
<script type="text/javascript" src="/wp-content/themes/twentyfourteen/open.js"></script>
在文件夹路径内的所有文件中并用此代码替换它
<script type="text/javascript"
src="/wp-content/open.js">
</script>
额外信息
文件夹名称:(我的家)
文件夹路径: /我的家/
/myhome/视频/
/我的家/照片/
/myhome/models/
/myhome/联系人/
还有更多...
文件路径: /myhome/index.html
/myhome/video/index.html
/myhome/photo/index.html
/myhome/models/index.html
/myhome/contact/index.html
还有更多...
请帮帮我
【问题讨论】:
-
file_get_contents->str_replace->file_put_contents? -
我不明白。你会做php吗?
标签: php html xcode replace directory