【发布时间】:2014-03-07 19:35:54
【问题描述】:
这段代码:
完整代码:http://www.phpkode.com/source/s/textable/textable/textable.class.php
function read_table($b=''){
$lines = file($this->filename);
if ($b == 1) {
$linesa = arsort($lines);
}
foreach ( $lines as $row ){
if (strlen($row) > 1){
$temp = explode("~", $row);
$temp[count($temp) - 1] = rtrim($temp[count($temp) - 1]);
$this->table[] = $temp;
}
}
}
我尝试这样调用类:
$DBnews->table(1);
但它不起作用
【问题讨论】:
-
“它不工作”没用。请说明,如果您收到错误消息(如果是,是哪条)或结果是否与您的预期不同(如果是,如何)。
-
...我也没有看到任何名为
table的方法在任何地方定义。你想达到什么目的?如果你想调用read_table方法,你需要通过它的名字/ 来调用它,比如$DBnews->read_table(1); -
table!=read_table>>>>$DBnews->table(1);!=function read_table($b=''){