如果你看看它明确定义和公开的代码。为什么我会遇到致命错误:调用未定义的函数prep_connections()?
<?php
class Config {
public function prep_connections($collection){
}
public function get_connctions(){
require_once('readfile.php');
$reader = new Readfile();
$collections = json_decode($reader->read("../../config/database.cfg"));
foreach($collections as $collection){
prep_connections($collection);
}
}
}
$config = new Config();
$connections = $config->get_connctions();
有一个在你发布的链接没有代码。 – 2012-07-30 14:01:59
您可以始终手动缩进代码 - 只需确保发布相关代码而不是小说。 – Matt 2012-07-30 14:04:59