- mb_detect_encoding: documentation ( source)
- mb_list_encodings: documentation ( source)
- array_diff: documentation ( source)
<?php
$test = 'test:test';
$encodings = array_diff(mb_list_encodings(), ['UUENCODE', 'wchar']);
echo mb_detect_encoding($test, $encodings, true);