Re: Subject: putting strings together with a linefeed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 character

So 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;
        charset="iso-8859-1"
Date: Fri, 16 Apr 2004 11:23:51 -0500
Message-ID: <AED295B4597E884A82081E567887C4F30E1C90@xxxxxxxxxxxxxxxxxxxxx>
From: "Hull, Douglas D" <ddhull@xxxxxx>
To: "Note To php mysql List (E-mail)" <php-db@xxxxxxxxxxxxx>
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


========================================================
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.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux