how would i...

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

Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

youc an change

Code: Select all

var_dump($output);
to

Code: Select all

echo "<pre>";
print_r($output);
echo "</pre>";
and it'll be easier to read!
User avatar
bawla
Forum Contributor
Posts: 116
Joined: Fri Mar 19, 2004 9:15 am

Post by bawla »

man i dont get php at all,
how would i be able to organize this better
like Short Group Name, Points,etc. for each group and a new group gets a new line

and y does that 'output'
array(32) { [0]=> array(7) { ["Short name of Group"]=> string(4) "BomB"
i mean y does it show array(32) { [0]=>array(7)
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

ok, look after you run that script, it will create a multideminsional array. say you wanted the first clans name and points. You would do:

Code: Select all

echo $output[0]['Short name of Group']; //will return BomB
echo $output[0]['Points']; //will return 10319814(unless its changed)
//for the second clan, you'd change teh first [0] to [1] and os on.
Does that help you understand??

[php_man]var_dump()[/php_man] function will dump everything in the variable. It will tell you how many elements are int he array and the length of strings, and i dunno what all else. But if you use print_r, it will just show you the array.
User avatar
bawla
Forum Contributor
Posts: 116
Joined: Fri Mar 19, 2004 9:15 am

Post by bawla »

i understand now, thanks
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

yeah, no problem!
Post Reply