<?php $a = '{"":{}}' ; $b = json_encode ( json_decode ( $a , true )); $c = json_encode ( json_decode ( $a , false )); echo " Want $a Get $b or $c " ;