![]() |
inStr Function
well, i've found this useful for many things so i figured i'd post it
PHP Code:
PHP Code:
|
|
not quite.
this checks to see if the needle is in the haystack, it dosent modify the needle or haystack in anyway |
It's pretty close. It does get around the 0 (match at first char)/false (no match) confusion that sometimes causes bugs with strpos, though. You could state this more succinctly as:
PHP Code:
|
Quote:
|
Seems rather silly to me. StrPos is very very very fast. Think if you have 100,000 characters. StrPos would take a matter of seconds, your function would take a lot longer.
Code:
if(strpos("The best site ever is CodingForums", "CodingForums")) |
Quote:
PHP Code:
|
| All times are GMT +1. The time now is 04:12 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.