Re: \n is not working!
| From: | Chris Shiflett | Date: | Sun, 04 Apr 2004 23:10:45 +0000 |
| Subject: | Re: \n is not working! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182310@lists.php.net to get a copy of this message | ||
--- Labunski <romans@skulme.lv> wrote:
> Why do this line $new_topic =
> $post_0.'|'.$post_1.'|'.'$post_2\n';
> writes to
> the document
> one|two|three\n
Actually, that's not true. Assuming:
$post_0 = 'one';
$post_1 = 'two';
$post_2 = 'three';
The code you posted will store the following in $new_topic:
one|two|$post_2\n
While others were able to answer your question anyway (anything within
single quotes is interpreted literally), this demonstrates how providing
misinformation can make it very difficult for people to help you.
As a courtesy to those who spend their time answering questions, please
test your code. It really only takes a moment of your time.
Thanks. :-)
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/