Jump to content

Recommended Posts

Hi,

 

I am trying to echo $details1 inside the div but it show like this....

 

For example:

 

Hello, how are you today...... What are you doing today?????

 

but if div width is smaller then text line then i want text to go under it automatically...

 

For example like this:

 

Hello, how are

you today... what

are you doing

today?????

 

 

<?php
if($details1) {
echo "<div id='detaildisplay_box' style='overflow: auto;'><code><xmp>$details1</xmp></code></div>";
}
else {
echo "No detail";
}
?>

Edited by arunpatal
Link to comment
https://forums.phpfreaks.com/topic/270777-div-problem/
Share on other sites

Just use an if.. else statement and use two variables. One for the single line of text and one for the text with the line breaks.

 

Then if div size is whatever, then echo $variable1, else echo $variable2.

Edited by Beeeeney
Link to comment
https://forums.phpfreaks.com/topic/270777-div-problem/#findComment-1392878
Share on other sites

Just use an if.. else statement and use two variables. One for the single line of text and one for the text with the line breaks.

 

Then if div size is whatever, then echo $variable1, else echo $variable2.

 

OK i go it............

 

Thanks

Edited by arunpatal
Link to comment
https://forums.phpfreaks.com/topic/270777-div-problem/#findComment-1392879
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.