0
我想通过从index.php开始分离代码(如上传文件)来妥善安排我的代码,如何在index.php中调用upload.php? upload.php不是一个函数。可能吗?从主文件中调用PHP文件
我想通过从index.php开始分离代码(如上传文件)来妥善安排我的代码,如何在index.php中调用upload.php? upload.php不是一个函数。可能吗?从主文件中调用PHP文件
<?php include('upload.php');?>
在index.php文件顶部
<?php
require_once 'upload.php';
//no close tag if you have no html code
可能还需要提的是,你可以使用`需要()'和/或`include_once()的`/`require_once()`。 include和require之间没有真正的区别(只有在失败时,require才会抛出不同的错误)。但是include/require和include_once/require_once是有区别的。 _once()方法会检查文件是否已经包含,如果有的话,它不会再包含它。 – eklundchristopher 2011-01-14 16:01:36