in reply to Matching first Letters of two words
Yes it is.
Please have a look at substr and Equality Operators.
Since the requirement mentioned ignoring case, pointers to lc and uc might also be helpful given your approach.
Cheers,
JohnGG