undefined offset

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sad2891
Forum Newbie
Posts: 9
Joined: Sat Nov 02, 2002 8:38 pm
Location: Orlando, Florida

undefined offset

Post by sad2891 »

ok now what is an undefined offset and where is it?

Code: Select all

<?php
for ($it=0;$loggerї$it];) {
?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It's when you're trying to access an array element which doesn't exist.

Eg:

Code: Select all

$array = array(0 => 'x', 1 => 'y', 2 => 'z');
echo $arrayї3];
will give you an offset error as there is no $array[3] defined.

Mac
Post Reply