Source Code:
(back to article)
<?php // Declare and initialize an array // $students = ['Rohan', 'Arjun', 'Niharika'] $students = [ 0 => 'Ann', 1 => 'Jennifer', 2 => 'Mary', ]; if (!empty($students[5])) { echo $students[5]; } else { echo "Index not present"; } ?>
Result:
Report an issue