- implode: documentation ( source)
- array_diff: documentation ( source)
- range: documentation ( source)
- str_split: documentation ( source)
- sprintf: documentation ( source)
<?php
$str = '914027';
if ($missNumbers = array_diff(range('0','9'), str_split($str))) {
echo sprintf("Missing: %s", implode(', ', $missNumbers));
}