iNET Interactive - Online Advertising Agency
          
   Home    Authors    About    Login    Contact Us
   Search:   
Advanced Search     
  Articles

  ASP (26)
  ASP.NET (19)
  C and C++ (4)
  CFML (2)
  CGI and Perl (16)
  Flash (2)
  Java (7)
  JavaScript (28)
  PHP (92)
  MySQL (13)
  MSSQL (3)
  HTML (34)
  SEO (9)
  Visual Basic (12)
  CSS (13)
  SSI (5)
  XML (12)
  C# (14)

  Developer News

May 12, 2008
Film Makers, Bands and Comedians Welcome on MySpace
About
 
May 12, 2008
Software Engineering for Ajax
WebReference.com
 
May 12, 2008
What is the Head Tag For?
About
 
May 11, 2008
Improving accessibility for motor impaired users
WebDevTips UK
 
May 11, 2008
10 ways to orientate users on your site
WebDevTips UK
 
May 11, 2008
Web Design Clinic - Rros restoration camp 2006
About
 
Courtesy of moreover.com
 
Want to receive new articles via e-mail? Click here!
/Home /PHP /Introduction to PHP

PHP Lesson One - Entry Point 

  Views:    29807
  Votes:    5
by James N Hitz 1/23/04 Rating: 

Synopsis:

Lesson 1: introduces the PHP basics outlining PHP strengths, weaknesses and also where to get PHP.
Pages: firstback1 2 3 4 5 6 7 9 forwardlast
The Article

Yes... Now What?!

Let's fix the problem. Try this:

<html><head><title>Hello PHP World</title></head>
<body>
<?php
     print("<h2>Hello PHP World</h2>");
     echo("<hr>");
     print("<p><font size=\"3\" color=\"red\">PHP seems like fun</font></p>");
?>
</body></html>

There! Solved. All quotes WITHIN a string of text MUST be escaped. In plain English, this means that they will require to be acknowledged as quotes within quotes. This is done by preceeding them with a fore-slash: (\").

Other escapes for popular "forbidden characters" are:


Escape Code What it Means 

\t  tab 
\@  @ 
\n  linefeed (LF or 0x0A in ASCII) 
\r  carriage return (CR or 0x0D in ASCII) 
\t  horizontal tab (HT or 0x09 in ASCII) 
\\  backslash 
\$  dollar sign 
\"  double-quote 
\...  and a host of others that are currently of little use to us (at least for now). 

"Thank you very much Sir. BUT, do I have to escape all the text all the time? Come On. How much time of escaping do you think that will cost me...."

Enough! Escaping can be a bore. That is a fact. Especially if you have a lot of text to output. Just imagine how much escaping you will do if you wanted to produce an electronic newsletter (e-newsletter). Not a pretty site either. So?!

Enter the Here document.

Pages: firstback1 2 3 4 5 6 7 9 forwardlast

Similar/related articles:


 
  Sponsors