Re: Breaking lines / NEW
| From: | Brad Bonkoski | Date: | Tue, 03 Oct 2006 17:21:32 +0000 |
| Subject: | Re: Breaking lines / NEW | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242546@lists.php.net to get a copy of this message | ||
Deckard wrote:
Hi Brad, Thanks a lot for your answer and the other guys too. It worked. Now i have another doubt: $stringData = '<?php' . "\n\n" . '$hostname = ' . '$hostname' . "\n" . '$database = wordlife' . "\n" .Simplify your life! $stringData = "<?php \n\n \$hostname = '$hostname'\n \$database = wordlife \n \$mysql_username = $mysql_username \n \$mysql_user_password = $mysql_user_password \n\n ?>"; the '\' character is the escape... so if $var = "string" echo "$var"; // output string echo "\$var"; //output $var -B'$mysql_username = ' . $mysql_username . "\n" .'$mysql_user_password = ' . $mysql_user_password . "\n\n" . '?>'; The variables contents should be written in the files within quotes, like: $mysql_username = 'deckard'; This is getting me nuts. Any ideas ? Warm Regards, Deckard Brad Bonkoski wrote:Deckard wrote:$stringData = '$hostname = ' . $hostname . "\n" . '$mysql_username = ' . $mysql_username . "\n" . '$mysql_user_password = ' . $mysql_user_password . "\n"; (double quotes around the \n character.) -BI have this code to write three lines in a file (config.php): $stringData = '$hostname = ' . $hostname . '\n' . '$mysql_username = ' . $mysql_username . '\n' . '$mysql_user_password = ' . $mysql_user_password . '\n'; but instead of breaking a line, it appears in the file the string \n How can i make the line break ? Any help would be appreciated. Best Regards, DeckardHello,