Skip to content

Instantly share code, notes, and snippets.

@abtris
Created October 28, 2011 17:46
Show Gist options
  • Select an option

  • Save abtris/1322871 to your computer and use it in GitHub Desktop.

Select an option

Save abtris/1322871 to your computer and use it in GitHub Desktop.
Convert json \uXXXX to UTF8 in PHP and prettyPrint in Zend Framework
<?php
$json = stripslashes(preg_replace("/u([0-9a-f]{3,4})/i","&#x\\1;", $json));
echo Zend_Json::prettyPrint($json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment