You're probably looking for something like regex.
e.g.
if (preg_match('/^[A-Za-z]+/', "NR2 2EY", $matches))
echo $matches[0];
Here my idea is to match alphabetic characters from the start until some non-alphabetic character is found, or the string terminates.