Jump to content

highest "element" in an array


SchweppesAle

Recommended Posts

http://ch.php.net/end

 

as for your 2nd question:

 

$temp = array();
foreach($array as $element){
  if($element !== NULL){
    $temp[] = $element;
  }
}
$array = $temp;

 

//edit:

 

to get the highest index, why not use count($array)-1; //(provided the index is continuous) else:

use array_keys() with end()

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.