Trouble with arrays

Posted by Ockonal on Stack Overflow See other posts from Stack Overflow or by Ockonal
Published on 2010-05-07T18:59:38Z Indexed on 2010/05/07 19:08 UTC
Read the original article Hit count: 186

Filed under:
|
|

Hi guys, I have such string in PHP:

$data = '1;3;5;7;9';

And cycle:

for ($i=0; $i < count($someArray); $i++)
{
   // If $i == any number in $data
}

What is the faster way to compare $i from cycle with numbers in string. I have to check that cycle-counter is in string.

© Stack Overflow or respective owner

Related posts about php

Related posts about array