Advertisement
Guest User

Untitled

a guest
Aug 11th, 2016
3,527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. {"2":"aaron@mail.com","1":"bernard@mail.com"}
  2.  
  3. $.getJSON('urlwithjsonresponse.com',function(response){
  4. console.log(response);
  5. });
  6.  
  7. {1:"bernard@mail.com",2:"aaron@mail.com"}
  8.  
  9. $a = [ 2 => "aaron@mail.com", 1 => "bernard@mail.com" ];
  10. $a = array_values( $a );
  11. exit( json_encode( $a ) );
  12.  
  13. $a = [
  14. 2 => [ "id" => 2, "email" => "aaron@mail.com" ],
  15. 1 => [ "id" => 1, "email" => "bernard@mail.com" ]
  16. ];
  17. exit( json_encode( array_values( $a ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement