Source Code:
(back to article)
<?php // Define an array of data to encode as JSON $data = [ 'name' => 'John Doe', 'age' => 30, 'email' => 'john.doe@example.com', ]; // Encode the array as a JSON string, with slashes unescaped $json = json_encode($data, JSON_UNESCAPED_SLASHES); // Output the resulting JSON string echo $json;
Result:
Report an issue