32 of 110 menu

PHP Array to JSON

In PHP, the array to JSON conversion is performed using the json_encode function. See the example:

<?php $arr = array['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5]; echo json_encode($arr); ?>

Code execution result:

{"a": 1, "b": 2, "c": 3, "d": 4, "e": 5}
English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline