Re: \n is not working!

From: Date: Sun, 04 Apr 2004 22:23:38 +0000
Subject: Re: \n is not working!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-182303@lists.php.net to get a copy of this message
\n must be included in double-quotes because it's treated like a variable. echo "This works\n"; // Displays: This works echo "This doesn't work\n'; // Displays: This doesn't work\n > From: romans@skulme.lv (Labunski) > Newsgroups: php.general > Date: Mon, 5 Apr 2004 00:58:35 +0300 > To: php-general@lists.php.net > Subject: \n is not working! > > \n isn't working properly. > > Why do this line $new_topic = > $post_0.'|'.$post_1.'|'.'$post_2\n'; writes to > the document > one|two|three\n > but not > one|two|three (and break) > > > > whole code: > > if ($a=="new"){ > $post_0 = $_POST["one"]; > $post_1 = $_POST["two"]; > $post_2 = $_POST["three"]; > if ($post_1 !=""){ > if ($post_2 !=""){ > $m_fails=fopen('../data/menu.txt','a'); > $new_topic = $post_0.'|'.$post_1.'|'.'$post_2\n'; > fwrite($m_fails,$new_topic); > fclose($m_fails); > }} > }

« previous php.general (#182303) next »