Jump to content

How do you know the defination of array and thier list in such variable ?


linux1880

Recommended Posts

Hi friends i am trying to add some feature in one script, I see everywhere in the script like $data_set["something"] and $another_set["another_thing"] like that, how do i actually know where in the script has this array defined ? Or is that array referring to a table with all the fields ? Or can people define such array on the fly and assume variables as they want ? Please help. Thank you.

well, searched but could not find any place where he has defined those array variables. They have also used lots session variables like $_SESSION['yeah_right'],  $SESSION['oh_no'] ... and blah are they need to be defoened as well or we can assigm anything on the fly ? Sorry for the stupid questions as i am new to php and this community. Thanks

It's possible the array was never explicitly defined. Doing something like this:

 

<?php
$foo['bar'] = 'foobar';

 

Is completely valid. Though, it's usually a good idea to define your arrays somewhere as not to create confusion if someone else is looking over your code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.