A
Anonymous
Guest
I'm and illustrator who has used javascript to control his website. I now need some more capabilities, so I'm picking up PHP. I've been coding for about 20 years in various languages, so I have a pretty good grounding to begin with.
However, I've immediately run into a problem...?
And it's just with the simple, first, "Hello World!" script.
The problem has to do with the single and double quote marks, and the line break symbol.
These lines:
<?php print('Hello, World!\n ...Hello, again\n');?>
<br>
<?php print("Hello, World!\n ...Hello, again\n");?>
Display like this:
Hello, World!\n ...Hello, again\n
Hello, World! ...Hello, again
The first PHP line, which uses a single quote symbol in the print string displays the \n rather than sending a line break.
The second PHP line, which uses the double quote symbol, doesn't display the \n, but it also doesn't do a line break.
Any idea what the problem is.... and it seems to me that the double and single quotes should act the same way...
Confused... :?:
However, I've immediately run into a problem...?
And it's just with the simple, first, "Hello World!" script.
The problem has to do with the single and double quote marks, and the line break symbol.
These lines:
<?php print('Hello, World!\n ...Hello, again\n');?>
<br>
<?php print("Hello, World!\n ...Hello, again\n");?>
Display like this:
Hello, World!\n ...Hello, again\n
Hello, World! ...Hello, again
The first PHP line, which uses a single quote symbol in the print string displays the \n rather than sending a line break.
The second PHP line, which uses the double quote symbol, doesn't display the \n, but it also doesn't do a line break.
Any idea what the problem is.... and it seems to me that the double and single quotes should act the same way...
Confused... :?: