Forum Moderators: coopster

Message Too Old, No Replies

substr() higher case check

         

jackvull

9:09 pm on Jun 25, 2006 (gmt 0)

10+ Year Member



is substr() case sensitive?

I am trying to look for occurrences of the letters EP in a string by themselves. However, it is picking up letters ep in other words like "keep", etc. Or could that just be because I am running it on Windows, which seems to be case insensitive.

Any other ideas on how to check just for the letters EP by themselves?

eeek

9:54 pm on Jun 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



is substr() case sensitive?

How could it be? substr() only applies numeric arguments to the string and returns specified part of the subject string unchanged.

eeek

9:55 pm on Jun 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Any other ideas on how to check just for the letters EP by themselves?

Perl compatable regular expression matching will do it.

jatar_k

5:21 am on Jun 26, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



[php.net...]

eeek

5:14 pm on Jun 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



He could use strpos (or stripos) to find the letters. But if he wants them as a word, pcre would be a lot easier.