Skip to content

Instantly share code, notes, and snippets.

@julp
Created March 7, 2012 12:45
Show Gist options
  • Save julp/1992905 to your computer and use it in GitHub Desktop.
Save julp/1992905 to your computer and use it in GitHub Desktop.
Unicode unescaping (\uXXXX + \Uxxxxxxxx)
<?php
$in = '\u0041\U00000062';
$out = transliterator_create('Hex-Any')->transliterate($in);
var_dump($out); # string(2) "Ab"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment