Skip to content

Instantly share code, notes, and snippets.

@baptistedonaux
Last active August 29, 2015 13:56
Show Gist options
  • Save baptistedonaux/8807246 to your computer and use it in GitHub Desktop.
Save baptistedonaux/8807246 to your computer and use it in GitHub Desktop.
Auto detect encod string and return the same string to UTF-8 encode.
<?php
mb_convert_encoding($string, "UTF-8", mb_detect_encoding($string));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment