对象与数组的相互转换

PHP----zend框架中: 用toarray()方法可以把对象变成数组

PHP----laravel框架中:->get()方法

  例:

  $list = DB::table('student_person') //查询student_person表中的数据
   ->select('number','email','mobile', 'date_of_birth','nickname','realname','birthday')//查询表中所有括号内,列字段的数据
   ->where('number',$id) //查询number等于$id的一行数据
  ->get(); //get方法对象变成数组
posted @ 2017-11-06 17:20  燃烧的果冻  阅读(98)  评论(0)    收藏  举报