ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
FAQ
Login
 
PHP Tutorial - Index
PHP Tutorial - Introduction to PHP
PHP Tutorial - Your First PHP Script
PHP Tutorial - Operators
PHP Tutorial - Conditional and Looping
PHP Tutorial - Functions
PHP Tutorial - Classes and Objects
PHP Tutorial - Working with Forms
PHP Tutorial - Advanced PHP Topics
PHP Tutorial - Advanced Class Concepts
     

 
Online Personal Trainer Certification
Personal Trainer Certification (Spanish)
Test Search by Job Title
Find a Personal Trainer
Job Resources
Free Self Tests and Quizzes
Find a Lawyer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Six Sigma Green Belt Certification
Lean Management Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Photography Course & Certification
Online Business Writing Course & Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Selling Skills Certification
Business Analysis Course
Green Living Course  free!
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
  All Online Courses
   

   
   
   
   
   
   

   
  Home > Courses, Tutorials & eBooks > PHP Tutorial > Your First PHP Script
 

PHP Tutorial - You First PHP Script

    Page 2 of 2
 

Output:

This is an example in which a number is assigned to a variable, which is further displayed on the web browser.

Example

<html>

<head>

<title>Example</title>

</head>

<body>

 

<?php

$txt=56;

echo $txt;

?>

 

</body>

</html>

 
 

Output:

In order to concatenate two or more variables together while displaying the result on screen, use the dot (.) operator.

Example

<html>

<head>

<title>Example</title>

</head>

<body>

 

<?php

$abc="Welcome to expertrating!";

$xyz=56;

echo $abc . " " . $xyz;

?>

 

</body>

</html>

 
 

Output:

Comments

In PHP, if a single line comment has to be made we use two backslashes //. If a double line or large comment block has to be made then it has to start with a /* and end with a */.

Example

<html>

<body>

 

<?php

//This is a comment

/*

This is

a comment

block

*/

echo "You have Learned about Comments.";

?>

 

</body>

</html>

 
 

Output:

     

 

 
     
Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
 
© ExpertRating 2006. All Rights Reserved.