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 7 8 9 forwardlast
The Article

"Hello <?PHP World ?>"

Let's create a Hello World code in PHP. Gosh I have seen "Hello World" so many times I at times think it's my name. Let's be different. Let's say "Hello PHP World"

<html><head><title>Hello PHP World</title><head>
<body bgcolor="black" text="white">
<?php
  print("<h3>Hello PHP World</h3>");
?>
</body></html>

There are a few things worth noticing:

  • the PHP code is embedded within HTML
  • PHP code MUST be escaped. In our example we have escaped our PHP using the standard method discussed earlier.
  • every PHP statement MUST end with a semi-colon (;). Java, Perl and JavaScript programmers are at peace with this
  • You can output text to the browser using the print() statement.
  • The text being output should be put within double quotes: "blah blah"
  • "plain HTML" can be output within a print() statement
  • Our code is indented. Yours doesn't have to be though. Just trying to be tidy inspite of me being... well.. me.
Pages: firstback1 2 3 4 5 7 8 9 forwardlast

Similar/related articles:


 
  Sponsors