Guest User

http://stackoverflow.com/questions/35170098/php-json-decode-

a guest
Feb 3rd, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.24 KB | None | 0 0
  1. <?php
  2. function test() {
  3.     $data = '["B015f6c48c43b7494", "B69036e96dccae075"]';
  4.     $result=[];
  5.     $decode = json_decode($data, true);
  6.     foreach($decode as $row){
  7.         array_push($result, ['id'=>$row]);
  8.     }
  9.     return $result;
  10. }
  11. var_dump(test());
Add Comment
Please, Sign In to add comment