Sunday, August 2, 2009

How do I write a PHP expression that tests whether an element of an array is defined?

If I have an array like so:





$array[0]=item1


$array[1]=item2


$array[2]=item3


$array[3]=item3





The elements 0 through 3 are defined. But array[4] is not defined. How do I write an expression that tests whether or not array[$i] is defined for($i=0; $i%26lt;=count($array); $i+=1)?

How do I write a PHP expression that tests whether an element of an array is defined?
Try this link.





http://us.php.net/manual/en/function.arr...

printable cards

No comments:

Post a Comment