Pass PHP Arrays to JSON and JavaScript Using json_encode
How to pass arrays from PHP to JSON and JavaScript using json_encode. Demonstrates with single-level numerically indexed and associative arrays. ... A numerically indexed PHP array is translated to an array literal in the JSON string. A JSON_FORCE_OBJECT ...