Welcome Guest, Not a member yet? Register   Sign In
Write a newline to a file
#1

[eluser]cinewbie81[/eluser]
Hi all, how to write a new line in a file ?? The following is my code:

Code:
$Content = '';
$Content = $Content.'123'.'\n';

Code above doesnt works for me, why ??
instead of newline, it print me '\n' into the file.. Anyone ?
#2

[eluser]Josh Giese[/eluser]
try using double quotes
#3

[eluser]cinewbie81[/eluser]
It's works now !! Thanks champion !!
and all this while, i thought single and double quotes act the same :p
#4

[eluser]Josh Giese[/eluser]
glad to help, i think thats the first ting i have been able to answer on the forums.

double quotes will process the php code inside them, single quotes will give you the string literal.

there for:
echo "$blah"; and echo '$blah'; are not the same.




Theme © iAndrew 2016 - Forum software by © MyBB