- mb_check_encoding: documentation ( source)
<?php
$char = chr(200);
echo 'ASCII: ', mb_check_encoding($char, 'ASCII') ? 'yup' : 'nope', PHP_EOL;
echo 'ISO-8859-1: ', mb_check_encoding($char, 'ISO-8859-1') ? 'yup' : 'nope', PHP_EOL;
echo 'UTF-8: ', mb_check_encoding($char, 'UTF-8') ? 'yup' : 'nope', PHP_EOL;