Re: Breaking lines
| From: | Deckard | Date: | Tue, 03 Oct 2006 18:00:39 +0000 |
| Subject: | Re: Breaking lines | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242557@lists.php.net to get a copy of this message | ||
Hi
Yes, it worked, but there's this strange thing.
The output of in to the file is:
$stringData = "<?php \n\n\$hostname = '$hostname'\n\$database =
'wordlife'\n\$mysql_username = '$mysql_username'\n$mysql_user_password =
'$mysql_user_password'\n\n?>";
is:
<?php
$hostname = 'localhost'
$database = 'wordlife'
$mysql_username = 'gamito'
blabla = 'blabla'
?>
i. e., the variable $mysql_user_password within quotes is assuming its
value, not the string $mysql_user_password, while the others are ok.
*sigh*
Warm Regards,
Deckard
Brad Bonkoski wrote:
> Deckard wrote:
>> Hello,
>>
>> I 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,
>> Deckard
>>
>>
>
> $stringData = '$hostname = ' . $hostname . "\n" . '$mysql_username =
> ' .
> $mysql_username . "\n" . '$mysql_user_password = ' .
> $mysql_user_password . "\n";
>
> (double quotes around the \n character.)
> -B
>