Forums | MacLife
You are not logged in.
#1 2004-12-18 9:32 am
Some PHP problems on OSX
I've been learning PHP recently and test the scripts with the web hosting on my Mac. I installed PHP and started up the web server, and most scripts run correctly.
However, I'm only learning and I've noticed a few errors with basic concepts that are quite frustrating. For starters, the "\n" command never works. Ever. <br /> works fine, but "\n" will not function. Nor will \t or \r. Yes, I'm aware of the difference between echo "xxx" and echo 'xxx'.
Any suggestions?
Thanks.
Offline
#3 2004-12-18 10:31 am
- zakatak
- Member

- From: Kalamazoo
- Registered: 2004-08-05
- Posts: 565
Re: Some PHP problems on OSX
real quick like... where are you trying to use the \n \t etc, to do? Are you trying to output into the HTML as a new line? because of the way that HTML is designed it won't work that way. But look at the source code that is rendered, it probably now has new lines where you said to put new lines...
make sure to remember how HTML outputs whitespace...
Offline
#4 2004-12-18 10:32 am
- zakatak
- Member

- From: Kalamazoo
- Registered: 2004-08-05
- Posts: 565
Re: Some PHP problems on OSX
grrrrr... 2minutes.... grrrr....
Offline
#5 2004-12-19 8:17 am
Re: Some PHP problems on OSX
Just to clarify for iZach, in case clarification is needed:
This:
Code:
echo "<br>";
will create a line break in your html output
This:
Code:
echo "\n";
will create a line break in your source code.
If you don't use newline characters liberally, your source code will a long, strung-together unreadable mess.
Offline

