Core Function IsIndexSet
From Sputnik Wiki
(Difference between revisions)
UberFoX (Talk | contribs)
(Created page with "<pre> IndexSet( <array>, <index> ) </pre> === Description === Check if an element exist at a given index ID within an array. === Parameters === ==== array ==== The array to ...")
Newer edit →
(Created page with "<pre> IndexSet( <array>, <index> ) </pre> === Description === Check if an element exist at a given index ID within an array. === Parameters === ==== array ==== The array to ...")
Newer edit →
Revision as of 17:51, 8 December 2011
IndexSet( <array>, <index> )
Contents |
Description
Check if an element exist at a given index ID within an array.
Parameters
array
The array to use.
index
The index to check (starts at 0).
Return Value
Success - Returns 1.
Failure - Returns 0.
Remarks
None
Example
$a = array("One", "Two"); println( "Index 0 is : " . (IsIndexSet($a, 0) ? "SET" : "NOT SET") ); println( "Index 1 is : " . (IsIndexSet($a, 1) ? "SET" : "NOT SET") ); println( "Index 2 is : " . (IsIndexSet($a, 2) ? "SET" : "NOT SET") ); // Delete an index and do it again unset($a[1]); println( "Index 0 is : " . (IsIndexSet($a, 0) ? "SET" : "NOT SET") ); println( "Index 1 is : " . (IsIndexSet($a, 1) ? "SET" : "NOT SET") ); println( "Index 2 is : " . (IsIndexSet($a, 2) ? "SET" : "NOT SET") );