[PHP-DB] putting strings together with a linefeed
For example, say I have a variable $mytext = 'what up doc'. Now I want to add the text 'not much' to the end of this variable. But I want to place a return or linefeed after the original text so when I echo $mytext it looks like: what up doc not much I tried: $mytext = 'what up doc'; $mytext .= chr(10) . 'not much';I also tried chr(13) 10 is linefeed and 13 is carriage return. Thanks for your previous help as well. Doug -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] putting strings together with a linefeed
\r\n should give a carriage return. i.e: $mytext = 'what up doc'; $mytext .= '\r\n not much'; --Nicole --- Nicole Swan Web Programming Specialist Carroll College CCIT (406)447-4310 -Original Message- From: Hull, Douglas D [mailto:[EMAIL PROTECTED] Sent: Friday, April 16, 2004 10:24 AM To: Note To php mysql List (E-mail) Subject: [PHP-DB] putting strings together with a linefeed For example, say I have a variable $mytext = 'what up doc'. Now I want to add the text 'not much' to the end of this variable. But I want to place a return or linefeed after the original text so when I echo $mytext it looks like: what up doc not much I tried: $mytext = 'what up doc'; $mytext .= chr(10) . 'not much';I also tried chr(13) 10 is linefeed and 13 is carriage return. Thanks for your previous help as well. Doug -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] putting strings together with a linefeed
- Original Message - From: Hull, Douglas D [EMAIL PROTECTED] For example, say I have a variable $mytext = 'what up doc'. Now I want to add the text 'not much' to the end of this variable. But I want to place a return or linefeed after the original text so when I echo $mytext it looks like: what up doc not much I tried: $mytext = 'what up doc'; $mytext .= chr(10) . 'not much';I also tried chr(13) 10 is linefeed and 13 is carriage return. What is missing is the markup interpreted by the browser. (Check the source after the script is processed). Something like this perhaps? ? $mytext = p style='margin:0'what up doc/p; $mytext .= chr(10) . p style='margin:0'not much/p; ? p?=$mytext;?/p The source of the document received from the server as text/html reads p style='margin:0'what up doc/p p style='margin:0'not much/p and this is interpreted and displayed by the browser as what up doc not much Louise -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php