eon201 Posted November 29, 2007 Share Posted November 29, 2007 Im searchina string for the characters ' PIN='. It works and pulls up the what I have searched for. The only problem is that it is also pulling up ' pin=' -notice the non caps Why is this? Can I force the function to be case sensitive? $findme22 = ' PIN='; $pinfinder = strpos($line, $findme22); Thanks. Eon201 Quote Link to comment Share on other sites More sharing options...
Orio Posted November 29, 2007 Share Posted November 29, 2007 stripos() Orio. Quote Link to comment Share on other sites More sharing options...
eon201 Posted November 29, 2007 Author Share Posted November 29, 2007 Ha! Sometimes I can be an idiot!! So so easy. Thanks Orio! Quote Link to comment Share on other sites More sharing options...
eon201 Posted November 29, 2007 Author Share Posted November 29, 2007 Another quick question about these two functions mentioned above. When seaching for a pattern in the string, will php pick up on the fact that I am looking for ' PIN=' or will it automatically ignore the whitespace??? This is very important in my search criteria. Is there some syntax that is specific to whitespace when using php?? Thanks. Eon201 Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 29, 2007 Share Posted November 29, 2007 Another quick question about these two functions mentioned above. When seaching for a pattern in the string, will php pick up on the fact that I am looking for ' PIN=' or will it automatically ignore the whitespace??? The manual doesn't say anything about whitespace specifically, but as it matches full strings, it's logical that the spaces will be matched as well. If you get into a situation where you are needing to actually match a true pattern rather than a static string, use preg_match() instead so you can use regular expressions to define your pattern criteria. 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.