Re: Subject: putting strings together with a linefeed
| From: | Neil Smith [MVP, Digital media] | Date: | Fri, 16 Apr 2004 22:14:29 +0000 |
| Subject: | Re: Subject: putting strings together with a linefeed | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33933@lists.php.net to get a copy of this message | ||
You should appreciate there is a difference between using double quotes and single quotes around a string.
So you can't say print('what up doc $mycarriagereturnvariable'); and expect it to output the value of $mycarriagereturnvariable. Next, you *can* use this construct within *double* quotes. Finally, there are special characters - "Escaped characters" you can use with PHP to generate a carriage return :
These include :
\t : Tab character \r : Carriage return character \n : Newline characterSo your string should be : print("what up doc\r\n"); Hope that helps Neil. At 16:23 16/04/2004 +0000, you wrote:
MIME-Version: 1.0 Content-Type: text/plain;======================================================== CaptionKit http://www.captionkit.com : Production tools for accessible subtitled internet media, transcripts and searchable video. Supports Real Player, Quicktime and Windows Media Player. VideoChat with friends online, get Freshly Toasted every day at http://www.fresh-toast.net : NetMeeting solutions for a connected world.charset="iso-8859-1"Date: Fri, 16 Apr 2004 11:23:51 -0500 Message-ID: <AED295B4597E884A82081E567887C4F30E1C90@bluebird2.home.ku.edu> From: "Hull, Douglas D" <ddhull@ku.edu> To: "Note To php mysql List (E-mail)" <php-db@lists.php.net> Subject: 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