Link to home
Start Free TrialLog in
Avatar of JiveMedia
JiveMediaFlag for Australia

asked on

PHP If First Word Equals

Hi,

I was wondering what would be the most efficient way of finding and testing against the first word (including first white space) within a string.

So say i had a variable $a that equaled something like 'P001 example word'. If i wanted to test this true or false based on whether 'P001 ' was found and first word in the string, what would be the best way of doing so?

Any help would be appreciated.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial