Undefined Index ... how so?

Hi Experts,

I have the following code:
<?php
    $alt = 1;
    foreach ($payees as $payee):
?>                                
            <tr>
                <td class="alt<?php echo $alt; ?>">
                    <a href="index.php?action=details&id=<?php echo $payee['id']?>">
                        <?php echo $payee['lName'] . ', ' . $payee['fName']; ?>
                    </a>   <?php    print_r($payee);?>
                </td>
            </tr>
<?php            
        $alt = $alt * (-1);
    endforeach;    
?>

Open in new window


This gives me the following error/output
Notice: Undefined index: lName in C:\inetpub\wwwroot\CSS_Reservations\addedit\payees\view_list.php on line 27

Notice: Undefined index: fName in C:\inetpub\wwwroot\CSS_Reservations\addedit\payees\view_list.php on line 27
, Array ( [id] => 358 [0] => 358 [fname] => Guadalupe [1] => Guadalupe [lname] => Arce [2] => Arce [archived] => 0 [3] => 0 ) 

Open in new window


Its saying that my lname is  undefined, where my print_r gives Arce as tha lname value?

I'm sure its something silly.
APD TorontoAsked:
Who is Participating?
 
Marco GasiFreelancerCommented:
Guadalupe [lname] => Arce not lName: php is case sensitive... How many times the same thing happened to me!!! :-)
0
 
APD TorontoAuthor Commented:
Yes, that was it! Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.