Skip to content

Instantly share code, notes, and snippets.

@ImpactSeo
ImpactSeo / encoding.php
Created June 22, 2016 12:12
Clean UTF-8
<?php
/**
* Main function to call before sending your text through API
*/
function clean_utf8($text)
{
$encoding = mb_detect_encoding($text, 'UTF-8, ISO-8859-1');
if($encoding==='UTF-8')