【发布时间】:2017-12-03 14:54:31
【问题描述】:
我正在调用要渲染的 36 个文件的内容。该脚本运行良好,但我想知道什么是更短的方法。我的代码:
<?php $arrays = file_get_contents('a01.txt'); echo $arrays;?>
<?php $arrays = file_get_contents('a02.txt'); echo $arrays;?>
<?php $arrays = file_get_contents('a03.txt'); echo $arrays;?>
<?php $arrays = file_get_contents('a04.txt'); echo $arrays;?>
... X 36 直到 ('a36.txt')
类似
<?php $arrays = file_get_contents('a04.txt-a36.txt'); echo $arrays;?>
【问题讨论】:
-
带有
foreach循环
标签: php