chadr-php Posted August 16, 2010 Share Posted August 16, 2010 I want to identify strings with AT&T in them. Can't seem to find the right way to do this due to the &. I am using the strpos function in this manner: if (strpos(($string), 'AT&T')) > 0) I don't need to input or display using http. This is just a php script that I'll run from the command prompt. Thanks. Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted August 16, 2010 Share Posted August 16, 2010 Assuming that it's really an & and not & then this works: if (strpos($string, 'AT&T') !== false) Not sure why you had all the parentheses in there. Quote Link to comment Share on other sites More sharing options...
chadr-php Posted August 16, 2010 Author Share Posted August 16, 2010 Oops, I was checking for > 0 when I really should have checked for !== false. Turns out that AT&T started as position 0 of the string I was using to check the script. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.