rAthus icon

[PHP] convert any string of any type to UTF-8

rAthus | PRO | 11/29/18 09:10:29 AM UTC | 0 ⭐ | 650 👁️ | Never ⏰ | []
PHP |

140 B

|

None

|

0 👍

/

0 👎

// convert any string of any type to UTF-8
function decode2utf8($str) {
    return (mb_detect_encoding($str)=='UTF-8')?$str:utf8_encode($str);
}

Comments