|
|
|
|
![]() ![]() |
Oct 15 2006, 07:26 AM
Post
#1
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 4,083 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() |
In php coding, when you escape certain characters, they have an impact on the output of an echo'd or printed string. ie "\r\n\t" should give you a new line and a tab before outputting the content for a line of printing. They vary by OS, I know, but I have tried all the variations I can think of and can't seem to control output using them.
Believe me, I have tried multiple variations and nothing works for me. I have checked the php.ini file for settings but I can't find where you can modify them. So the question is : Where do i look to confirm the settings for using these Control Characters in the php parser or config files? Anyone know? And thanks in advance. |
|
|
|
Oct 15 2006, 02:15 PM
Post
#2
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 873 Joined: 30-July 04 Member No.: 246 |
What exactly are you trying to output, and what are you trying to view it in? A web browser simply ignores newlines for formatting in an HTML document, generally treating them simply as a space. Try setting the Content-Type header to text/plain or using the preformatted tag (<pre>), or just add a '<br>' to your string.
|
|
|
|
Oct 15 2006, 04:49 PM
Post
#3
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 4,083 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() |
I hate steortypes, but I was having a 'blonde' moment there.
Thanks, Spectre. *kicks self* |
|
|
|
Oct 15 2006, 10:56 PM
Post
#4
|
|
|
Member [Level 2] ![]() Group: [MODERATOR] Posts: 80 Joined: 25-March 05 Member No.: 4,879 |
If that was the answer, I so totally didn't understand the question. The special characters are used for formating text only. They are generally used in PHP to format the outputed HTML like so:
This PHP: CODE echo "<body>\n\t<table>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\tContent Here!<br />\n\t\t\t\tMore content here!\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</body>"; Would output this HTML: CODE <body> <table> <tr> <td> Content Here!<br /> More content here! </td> </tr> </table> </body> Which after the browser displays it would look like this: QUOTE Content Here! More content here! I use this to format my HTML in a way that makes it more organized and easier to read later. Makes debugging much easier. This is also used for line breaks and tabs in the HTML textarea object. Hope this helps. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 13th October 2008 - 12:10 PM |