我正在尝试包含一个文件(如果存在),如果该文件不存在,我希望它包含另一个文件。
我有以下似乎可以正常工作的代码,我的代码的唯一问题是如果文件确实存在,那么它会同时显示它们。
我只想包括
包含/article.php
如果
包括/'.$future.'.php
不存在。
如果
包括/'.$future.'.php
存在我不想包括
包含/article.php
<?php
$page = $_GET['include'];
if (file_exists('include/'.$future.'.php')){
include('include/'.$future.'.php');
}
else{
include('include/article.php');
}
?>