<?php
$array = array('nome'=>'Paição','cidade'=>'São Paulo');
//encode
//Output: {"nome":"Paição","cidade":"São Paulo"}
echo $json . '<br>';
PD9waHAKCiAgICAkYXJyYXkgPSBhcnJheSgnbm9tZSc9PidQYWnDp8OjbycsJ2NpZGFkZSc9PidTw6NvIFBhdWxvJyk7CiAgICAKICAgICRhcnJheSA9IGFycmF5X21hcCgnaHRtbGVudGl0aWVzJywkYXJyYXkpOwogICAgCiAgICAvL2VuY29kZQogICAgJGpzb24gPSBodG1sX2VudGl0eV9kZWNvZGUoanNvbl9lbmNvZGUoJGFycmF5KSk7CiAgICAKICAgIC8vT3V0cHV0OiB7Im5vbWUiOiJQYWnDp8OjbyIsImNpZGFkZSI6IlPDo28gUGF1bG8ifQogICAgZWNobyAkanNvbiAuICc8YnI+JzsKCg==