Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. <?php
  2.  $var=array(
  3.     'users' => array()
  4.  );
  5.  
  6.  $b = array(
  7.     new StdClass,
  8.     new StdClass,
  9.     new StdClass,
  10.     new StdClass
  11.  );
  12.  
  13. foreach ( $b as $a )
  14. {
  15.     $var['users'][] = $a;
  16. }
  17.  
  18. echo json_encode($var);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement