nomadsoul Posted May 26, 2011 Share Posted May 26, 2011 Hi, In the script on page 5 line 40, in the print_r function's argument, what is the "1" for? echo '<h3>Array As Is</h3><pre>' . print_r($students, 1) . '</pre>'; thanks Link to comment Share on other sites More sharing options...
Antonio Conte Posted May 26, 2011 Share Posted May 26, 2011 If you want to return the information from print_r rather than print it, use TRUE (1 boolean as in this example). echo '<h3>Array As Is</h3><pre>' . print_r($students, TRUE) . '</pre>'; Is working exactly the same way. 1 Link to comment Share on other sites More sharing options...
nomadsoul Posted May 26, 2011 Author Share Posted May 26, 2011 If you want to return the information from print_r rather than print it, use TRUE (1 boolean as in this example). echo '<h3>Array As Is</h3><pre>' . print_r($students, TRUE) . '</pre>'; Is working exactly the same way. Thanks, Antonio. Link to comment Share on other sites More sharing options...
Larry Posted May 27, 2011 Share Posted May 27, 2011 Thanks, Antonio. For future reference, this is the kind of question that's very quickly answered by looking up the function definition in the PHP manual. Link to comment Share on other sites More sharing options...
Recommended Posts