aebstract Posted October 6, 2008 Share Posted October 6, 2008 I have a file with the following code: <?php $emails = array([email protected], [email protected], [email protected], [email protected], [email protected]); echo $emails; ?> This is returning a white page, how come? Link to comment https://forums.phpfreaks.com/topic/127226-solved-array-not-working/ Share on other sites More sharing options...
aebstract Posted October 6, 2008 Author Share Posted October 6, 2008 I put each email inside double quotation marks and now it echos "Array". edit: I guess I need to run a loop to echo out each line from the array.. Link to comment https://forums.phpfreaks.com/topic/127226-solved-array-not-working/#findComment-658042 Share on other sites More sharing options...
Orio Posted October 6, 2008 Share Posted October 6, 2008 You can either use print_r($emails) to print the array, or just loop through it and print it's contents. But for debugging and checking print_r() could be very useful: <?php $emails = array("[email protected]", "[email protected]", "[email protected]"); echo "<pre>"; print_r($emails); echo "</pre>"; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/127226-solved-array-not-working/#findComment-658054 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.