to select the first three characters from any string, you can use $three = substr($str, 0, 3);
to grab the first three numbers that appear in a string, possibly preceded by letters, you could use
preg_match('/.*?(\d{3})/i', $str, $matches);
$matches[1]; will contain the first 3 numbers