用php或者laravel怎么切割一个文件?比如,有个location.blade.php
<div class="card-block">
<div class="row">
<div class="col-1">北京</div>
<div class="col-11">
<a href="#" class="card-link">东城</a>
<a href="#" class="card-link">西城</a>
<a href="#" class="card-link">朝阳</a>
<a href="#" class="card-link">海淀</a>
</div>
</div>
</div>
<div class="card-block">
<div class="row">
<div class="col-1">上海</div>
<div class="col-11">
<a href="#" class="card-link">黄浦</a>
<a href="#" class="card-link">卢湾</a>
<a href="#" class="card-link">徐汇</a>
<a href="#" class="card-link">长宁</a>
</div>
</div>
</div>
<div class="card-block">
<div class="row">
<div class="col-1">天津</div>
<div class="col-11">
<a href="#" class="card-link">和平</a>
<a href="#" class="card-link">河东</a>
<a href="#" class="card-link">河西</a>
<a href="#" class="card-link">南开</a>
</div>
</div>
</div>
我想写个脚本,把它切割成三个文件:beijing.blade.php
<div class="card-block">
<div class="row">
<div class="col-1">北京</div>
<div class="col-11">
<a href="#" class="card-link">东城</a>
<a href="#" class="card-link">西城</a>
<a href="#" class="card-link">朝阳</a>
<a href="#" class="card-link">海淀</a>
</div>
</div>
</div>
shanghai.blade.php
<div class="card-block">
<div class="row">
<div class="col-1">上海</div>
<div class="col-11">
<a href="#" class="card-link">黄浦</a>
<a href="#" class="card-link">卢湾</a>
<a href="#" class="card-link">徐汇</a>
<a href="#" class="card-link">长宁</a>
</div>
</div>
</div>
tianjin.blade.php
<div class="card-block">
<div class="row">
<div class="col-1">天津</div>
<div class="col-11">
<a href="#" class="card-link">和平</a>
<a href="#" class="card-link">河东</a>
<a href="#" class="card-link">河西</a>
<a href="#" class="card-link">南开</a>
</div>
</div>
</div>
需要怎么做?请大神帮说一下。
- 4 回答
- 0 关注
- 446 浏览
添加回答
举报
0/150
提交
取消