Quote:
|
Originally Posted by Slash-P2P
I find strcontains easy so I use that a lot.
I believe you can get an exact answer with strcontains if you use quotations around the data your searching in.
Nice sig.
|
If you mean getting the index value, no. Otherwise, please do clarify your post
PHP Code:
//--detecting element in list
if (strcontains(#s(foo),bar))
if (lindexof(bar,foo))
//--finding element in list
this.index = lindexof(bar,foo);
for (i=0;i<sarraylen(bar);i++) { //<- this is freaking ugly and I will hit you if you use it
if (strcontains(#I(bar,i),foo)) {
this.index = i;
}
}
It depends on what you are doing. As far as which function has the more efficient underlying code, I don't know. (only applicable in determining if an element is in a list though)