fork download
  1. <?php
  2.  
  3. $data = ['admin@admin.ru', 'test@test.ru'];
  4. $data = array_map(function($email) {
  5. return ['email' => $email];
  6. }, $data);
  7. echo json_encode($data, JSON_PRETTY_PRINT);
Success #stdin #stdout 0.01s 82560KB
stdin
Standard input is empty
stdout
[
    {
        "email": "admin@admin.ru"
    },
    {
        "email": "test@test.ru"
    }
]