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)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Makeup Artist Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant 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 2015. All Rights Reserved.