Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rajvanshipradeep15/83e8bd2bb3d5e8b69f392ba241e6f0fd to your computer and use it in GitHub Desktop.
Save rajvanshipradeep15/83e8bd2bb3d5e8b69f392ba241e6f0fd to your computer and use it in GitHub Desktop.
clean html when compiler process only php code not html
function clean($str)
{
$str = utf8_decode($str);
$str = str_replace(" ", "", $str);
$str = preg_replace("/\s+/", " ", $str);
$str = trim($str);
return $str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment