...

View Full Version : question on print



musher
09-01-2006, 03:39 AM
is there a way to a line feed in a line like this (I'm trying to put a line feeds inbetween the two div closes and dive spacer)


print ($i % 2) ? ' </div> </div><div class="spacer"> </div>' : ' </div>';echo"\r\n";
normal I would code something like this makes it a bit easer when looking at source to debug.


echo ' <div class="general_section">'."\n";
echo ' <h5>Module Maintenance Sections</h5>'."\n";

Brandoe85
09-01-2006, 04:53 AM
You can do it the same way:


print ($i % 2) ? ' </div> </div><div class="spacer"> </div>' : ' </div>' . "\r\n";

musher
09-01-2006, 05:08 AM
You can do it the same way:


print ($i % 2) ? ' </div> </div><div class="spacer"> </div>' : ' </div>' . "\r\n";


My Bust, let me re-explain, I'm trying to do is something like this


print ($i % 2) ? ' </div> (\n **line Feed Here**) </div> (\n **line Feed Here**) <div class="spacer"> </div>' : ' </div>' . "\n";

Brandoe85
09-01-2006, 05:14 AM
Concatenate?


print ($i % 2) ? ' </div>' . "\n" . '</div>' . "\n" . '<div class="spacer"> </div>' : ' </div>' . "\n";

Or i'm missing it :o

musher
09-01-2006, 05:38 AM
Thanks Brandoe85, :thumbsup:

Well I was close i did try :confused:

' </div>' . '\n'. '</div>' . '\n' . '<div class="spacer"> </div>'

Brandoe85
09-01-2006, 05:42 AM
You were, php understands escape sequences in double quotes. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum