Jul 22, 2004 #1 Thomas001 Programmer Joined Jun 24, 2004 Messages 29 Location US Does anyone know a good way I can print out an entire array? All I know is that it would probably require a loop of some sort. Thanks
Does anyone know a good way I can print out an entire array? All I know is that it would probably require a loop of some sort. Thanks
Jul 22, 2004 #2 Vragabond Programmer Joined Jul 23, 2003 Messages 5,100 Location AT You have a built-in function in php. Print recursive or print_r: Code: <?php echo '<pre>'; print_r($array); echo '</pre>'; ?> Pre tags are for easier reading. Upvote 0 Downvote
You have a built-in function in php. Print recursive or print_r: Code: <?php echo '<pre>'; print_r($array); echo '</pre>'; ?> Pre tags are for easier reading.
Jul 22, 2004 #3 cLFlaVA Programmer Joined Jun 14, 2004 Messages 6,450 Location US Yup. Loop it up. Code: $stuffArray[0] = "some stuff"; $stuffArray[1] = "other stuff"; $stuffArray[2] = "last stuff"; foreach ($stuffArray as $stuffItem) { echo $stuffItem . "<br>\n"; } *cLFlaVA ---------------------------- A polar bear walks into a bar and says, "Can I have a ... beer?" The bartender asks, "What's with the big pause? Upvote 0 Downvote
Yup. Loop it up. Code: $stuffArray[0] = "some stuff"; $stuffArray[1] = "other stuff"; $stuffArray[2] = "last stuff"; foreach ($stuffArray as $stuffItem) { echo $stuffItem . "<br>\n"; } *cLFlaVA ---------------------------- A polar bear walks into a bar and says, "Can I have a ... beer?" The bartender asks, "What's with the big pause?