encode json with string code example
Example 1: json_encode()
json_encode(['name' => 'Jake', 'country' => 'Philippines'])
Example 2: json encode
<?php
$age = array("Peter"=>35, "Ben"=>37, "Joe"=>43);
echo json_encode($age);
?>
json_encode(['name' => 'Jake', 'country' => 'Philippines'])
<?php
$age = array("Peter"=>35, "Ben"=>37, "Joe"=>43);
echo json_encode($age);
?>