3v4l.org

run code in 500+ PHP versions simultaneously
<?php $accountdata = array( array("name" => "test1", "email" => "test1@test.com"), array("name" => "test2", "email" => "test2@test.com"), array("name" => "test3", "email" => "test3@test.com"), array("name" => "test4", "email" => "test4@test.com"), ); foreach ($accountdata as $row) { $data[$row["email"]] = [ 'name' => $row["name"], 'email' => $row["email"] ]; } echo json_encode($data, JSON_UNESCAPED_UNICODE);

preferences:
77.37 ms | 1153 KiB | 5 Q