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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.