Quantcast
Channel: PHP array next value of a value - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by Denny Sutedja for PHP array next value of a value

hope this help:while (($next = next($items)) !== NULL) { if ($next == 'three') { break; }}$next = next($items);echo $next;for large array u can use :$src = array_search('five',$items); // get array...

View Article



Answer by Memor-X for PHP array next value of a value

I have this$input = "nine";$items = array('1' => 'two','9' => 'four','7' => 'three','6'=>'seven','11'=>'nine','2'=>'five');$keys = array_keys($items);$size = count($keys);$foundKey =...

View Article

Answer by L. Herrera for PHP array next value of a value

If that's the case, you should first prepare your array. Based on your given array, it seems the index is not consecutively correct. Try using array_values() function.$items = array('1' => 'two','9'...

View Article

PHP array next value of a value

How to get next value of a value from array.I have one array like this $items = array('1' => 'two','9' => 'four','7' => 'three','6'=>'seven','11'=>'nine','2'=>'five');how to get next...

View Article
Browsing all 4 articles
Browse latest View live


Latest Images