I believe you mean 4 first characters are digits. You might wanna use regular expressions for that:
if (preg_match('/^\d{4}.*/', $yourSingleLineString))
{
//it is starting by 4 digits so do what you need to
}
preg_match checks if your string matches the pattern given. The pattern actually says: starting from the beginning of the line (^) the digit (\d) repeats 4 times ({4}) and then there are any characters (.) zero or more times (*).