Home > php教程 > php手册 > body text

php 重组数组

WBOY
Release: 2016-06-06 20:00:10
Original
2036 people have browsed it

一 .代码 TLog::info(var_export($res,true)); $res = array_map('array_shift', $res); TLog::info(var_export($res,true)); 二.结果 2015-01-09 11:06:34 INFO PID:0 /data/www/webapp/app_qjob_com/lib/SubscribeService.class.php line 343 ip:127.0.0.1

一 .代码
TLog::info(var_export($res,true));
$res = array_map('array_shift', $res);

TLog::info(var_export($res,true));

二.结果

2015-01-09 11:06:34     INFO    PID:0           /data/www/webapp/app_qjob_com/lib/SubscribeService.class.php    line 343        ip:127.0.0.1            array (
  0 => 
  array (
    'object_id' => '4',
  ),
  1 => 
  array (
    'object_id' => '1',
  ),
  2 => 
  array (
    'object_id' => '1',
  ),
  3 => 
  array (
    'object_id' => '1',
  ),
  4 => 
  array (
    'object_id' => '1',
  ),
  5 => 
  array (
    'object_id' => '1',
  ),
)
2015-01-09 11:06:34     INFO    PID:0           /data/www/webapp/app_qjob_com/lib/SubscribeService.class.php    line 346        ip:127.0.0.1            array (
  0 => '4',
  1 => '1',
  2 => '1',
  3 => '1',
  4 => '1',
  5 => '1',
)


三浏览器返回

{"errno":0,"data":["4","1","1","1","1","1"]}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template