小编Sar*_*dor的帖子

Php array_values不起作用

我在Zend框架中有一个方法

public static function selectWithWhere(array $row_names, array $values) {
        $db = Zend_Db_Table_Abstract::getDefaultAdapter();

        $selectData = new Zend_Db_Select($db);
        $selectData->from('other_directions');
        $i = 0;
        $length = count($values);
        $where = array();
        foreach($row_names as $row_name){
            $where[] = $selectData->where($row_name . '=?', $values[$i]);
            $i++;
        }
        $where[$length - 1];
        $data = $db->query($selectData);
        $data = $data->fetchAll();
        $allDirections[] = array();
        if($data == null){
            return null;
        }
            foreach ($data as $d) {
                $direction = new Admin_Object_OtherDirections();
                $direction->setOtherDirectionId($d['other_direction_id']);
                $direction->setNoticeId($d['notice_id']);
                $direction->setDirectionTypeId($d['direction_type_id']);
                $direction->setOtherDirectionName($d['other_direction_name']);
                if(isset($direction)){
                    $allDirections[] = $direction;
                }
            }
            $allDirections = array_values($allDirections);
        return $allDirections;
    } …
Run Code Online (Sandbox Code Playgroud)

php zend-framework

1
推荐指数
1
解决办法
1202
查看次数

Zend - 获取所有登录用户

我正在研究Zend Framework.我有问题Zend_Auth.

我必须得到所有登录用户.我怎样才能做到这一点?

php zend-framework zend-auth

0
推荐指数
1
解决办法
239
查看次数

标签 统计

php ×2

zend-framework ×2

zend-auth ×1