iconicCreator Posted May 19, 2009 Share Posted May 19, 2009 I am practicing to have random images display on my page when the page is refresh or reloaded. This is just the part of the code I'm trying to add a line break to. <?php $images = array( array('file' => 'image1', 'caption' => 'Good morning, my name is Rick, how may I help you?'), array('file' => 'image2', 'caption' => 'Good morning, my name is Dianna, how may I help you'), array('file' => 'image3', 'caption' => 'Good morning, my name is David, how may I help you'), array('file' => 'image4', 'caption' => 'Good morning, my name is Mary, how may I help you'), ); $i = rand(0, count($images)-1); $selectedImage = "images/{$images[$i]['file']}.png"; $caption = $images[$i]['caption']; ?> I feel dumb asking this but I have tried and cannot get it to work with out trying to add an html line break in the html code. I need the return text to the browser to look like this. Good morning, My name is blah blah, how can I help you? Right now it's just all on one line. How can I add a line break in here? Thanks for your help! IC Link to comment https://forums.phpfreaks.com/topic/158810-solved-php-novice-how-can-i-insert-a-line-break-in-the-code/ Share on other sites More sharing options...
Ken2k7 Posted May 19, 2009 Share Posted May 19, 2009 Use <PRE>? Link to comment https://forums.phpfreaks.com/topic/158810-solved-php-novice-how-can-i-insert-a-line-break-in-the-code/#findComment-837604 Share on other sites More sharing options...
iconicCreator Posted May 19, 2009 Author Share Posted May 19, 2009 Use <PRE>? Actually, I just inserted a break tag within the script and because this file is within an include folder, it can actually be display as a break within the html page. Thanks anyway, I really appreciate your time and efforts. IC Link to comment https://forums.phpfreaks.com/topic/158810-solved-php-novice-how-can-i-insert-a-line-break-in-the-code/#findComment-837615 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.