SlideShare a Scribd company logo
PHP Course
PHP is a server scripting language, powerful tool for
making dynamic and interactive Web pages..
This presentation provide you with PHP source code and the HTML
output of that code………….Enjoy!.
PHP Course Info@ITBigDig.com
Instructor
 Name: Mohamed Saad.
 Email: Engsaad_aly@hotmail.com
 Occupation: Web Developer In IT Big Dig.
PHP Course Info@ITBigDig.com
PHP Course
1: Variables & Comments
PHP Course Info@ITBigDig.com
Naming Rules
PHP Course Info@ITBigDig.com
• $ sign then Name of the variable.
• Begin with a letter or the underscore character.
• Name can only contain alpha-numeric characters and
underscores.
• Name Should not contain spaces.
• Variable names are case sensitive.
• No command for declaring a variable.
Variables
Variables
Scopes
PHP Course Info@ITBigDig.com
Global Declared outside of any function.
Local
Declared within a PHP function can only be accessed within that
function
Static
When a function is completed, all of its variables are normally
deleted. However, sometimes you want a local variable to not be
deleted. use the static keyword .
Parameter
A parameter is a local variable whose value is passed to the
function by the calling code.
Variables
Data Types
PHP Course Info@ITBigDig.com
String Hello Mohamed Saad
Integer 48, -5, 160,…
Double 2.209, -1.3, 3.14,…
Boolean True or False
Date 2015-12-31 12:55:22
PHP Course Info@itBigDig.com
Athematic Operators
Operator Name Description
A + B Addition Sum of A and B
A - B Subtraction Difference of A and B
A * B Multiplication Product of A and B
A / B Division Quotient of A and B
A % B Modulus Remainder of A divided by B
A . B Concatenation Concatenate two strings
Dreamweaver
Create New Site
PHP Course Info@itBigDig.com
Dreamweaver CS 6
Dreamweaver
From Site menu Select New Site
PHP Course Info@itBigDig.com
project
Navigate to desktop and
create New Folder
Dreamweaver CS 6
Dreamweaver
Configure Your Server
PHP Course Info@itBigDig.com
Navigate to desktop and
create New Folder
Dreamweaver CS 6
Dreamweaver
Configure Your Server
PHP Course Info@itBigDig.com
Configure your server
Dreamweaver CS 6
Dreamweaver
Configure Your Server
Dreamweaver CS 6
PHP Course Info@itBigDig.com
Server name any name
FTB Address Domain
Username FTP User
Password FTP Pass
Root Folder on your
host
For this Tutorial I created a
Demo folder on my host and we
will use it along
Dreamweaver
Configure Your Server
Dreamweaver CS 6
PHP Course Info@itBigDig.com
Dreamweaver
Rename File: variables.php
Dreamweaver CS 6
PHP Course Info@itBigDig.com
PHP Tag
Open variables.php and insert basic code
<?php
?>
PHP Course Info@itBigDig.com
Copy Code
Open variables.php and insert basic code
<?php
?>
PHP Course Info@itBigDig.com
<!DOCTYPE html>
<html>
<body>
<?php
?>
</body>
</html>
PHP String Data
Output Data
<?php
echo “ ”;
?>
PHP Course Info@itBigDig.com
PHP String Data
Store & Output Data
<?php
$VariableName= „Saad‟ ;
?>
PHP Course Info@itBigDig.com
PHP String Data
Concatenation Operator
<?php
echo $first . " " . $last ;
?>
PHP Course Info@itBigDig.com
PHP String Data
Get Type Function
<?php
echo gettype($user);
?>
PHP Course Info@itBigDig.com
<?php
echo strlen($user);
?>
PHP Course Info@itBigDig.com
PHP String Data
String Length Function
<?php
echo strpos("Hello","H")
?>
PHP Course Info@itBigDig.com
PHP String Data
Search for a text
<?php
echo chr(65)
?>
PHP Course Info@itBigDig.com
PHP String Data
Character Function
<?php
echo chr(65)
?>
PHP Course Info@itBigDig.com
PHP String Data
Character Function
Comments
Insert comments & add remarks to your code.
PHP Course Info@ITBigDig.com
Single Line
• //Comments here
Multi Lines
• /*
Comments here
Comments here
*/
Dig …?
calculate the Area of square which have the
Length of 4 cm.
Print the result in
• Meter (m).
• Centimeter (Cm).
• Millimeter (mm).
PHP Course Info@ITBigDig.com
Answer
PHP Course Info@ITBigDig.com
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Square Area</title>
</head>
<body>
<?php
$x=1;//legnth in centimeter
echo "Length of the square =$x <br/>";//Print out the length
$meter=$x/1000;//legnth in meter
$Ameter =$meter*$meter;//Area in meter
echo "Area of the square= $Ameter M<sup>2</sup> <br/>";
$Acent = $x*$x;//Area in centimeter
echo "Area of the square= $Acent Cm<sup>2</sup> <br/>";
$milli =$x*1000;//legnth in millimeter
$Amilli=$milli*$milli;//Area in millimeter
echo "Area of the square= $Amilli mm<sup>2</sup>";
?>
</body>
</html>
PHP Course Info@ITBigDig.com
Copy Code
We hope You enjoy This Tutorial.
For any Suggestions Please email Us
Info@ITBigDig.com
PHP Course Info@ITBigDig.com
End
Variables & Comments
Itbigdig.com

More Related Content

What's hot

Introduction to Webcomponents
Introduction to WebcomponentsIntroduction to Webcomponents
Introduction to Webcomponents
Neha Sharma
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAMLJon Dean
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
Jainul Musani
 
Lesson 2: Getting To Know HTML
Lesson 2: Getting To Know HTMLLesson 2: Getting To Know HTML
Lesson 2: Getting To Know HTML
Olivia Moran
 
Php workshop L02 php basics
Php workshop L02 php basicsPhp workshop L02 php basics
Php workshop L02 php basics
Mohammad Tahsin Alshalabi
 
Php workshop L0 Introduction
Php workshop L0 IntroductionPhp workshop L0 Introduction
Php workshop L0 Introduction
Mohammad Tahsin Alshalabi
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
Jainul Musani
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Mohammad Tahsin Alshalabi
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
 
Up & Running with Polymer
Up & Running with PolymerUp & Running with Polymer
Up & Running with Polymer
Fiyaz Hasan
 
9. lower in Symfony 4
9. lower in Symfony 49. lower in Symfony 4
9. lower in Symfony 4
Razvan Raducanu, PhD
 
An SEO’s Intro to Web Dev PHP
An SEO’s Intro to Web Dev PHPAn SEO’s Intro to Web Dev PHP
An SEO’s Intro to Web Dev PHP
Troyfawkes
 
Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.
Harsh Mathur
 
Web development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer CentreWeb development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer Centre
jatin batra
 
11. move in Symfony 4
11. move in Symfony 411. move in Symfony 4
11. move in Symfony 4
Razvan Raducanu, PhD
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
Cyril Balit
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
Sergey Bolshchikov
 
7. copy2 in Symfony 4
7. copy2 in Symfony 47. copy2 in Symfony 4
7. copy2 in Symfony 4
Razvan Raducanu, PhD
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
vmmanikandan
 
dictionary2gether.com
dictionary2gether.comdictionary2gether.com
dictionary2gether.commakarakao
 

What's hot (20)

Introduction to Webcomponents
Introduction to WebcomponentsIntroduction to Webcomponents
Introduction to Webcomponents
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Lesson 2: Getting To Know HTML
Lesson 2: Getting To Know HTMLLesson 2: Getting To Know HTML
Lesson 2: Getting To Know HTML
 
Php workshop L02 php basics
Php workshop L02 php basicsPhp workshop L02 php basics
Php workshop L02 php basics
 
Php workshop L0 Introduction
Php workshop L0 IntroductionPhp workshop L0 Introduction
Php workshop L0 Introduction
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
Up & Running with Polymer
Up & Running with PolymerUp & Running with Polymer
Up & Running with Polymer
 
9. lower in Symfony 4
9. lower in Symfony 49. lower in Symfony 4
9. lower in Symfony 4
 
An SEO’s Intro to Web Dev PHP
An SEO’s Intro to Web Dev PHPAn SEO’s Intro to Web Dev PHP
An SEO’s Intro to Web Dev PHP
 
Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.
 
Web development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer CentreWeb development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer Centre
 
11. move in Symfony 4
11. move in Symfony 411. move in Symfony 4
11. move in Symfony 4
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
7. copy2 in Symfony 4
7. copy2 in Symfony 47. copy2 in Symfony 4
7. copy2 in Symfony 4
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
dictionary2gether.com
dictionary2gether.comdictionary2gether.com
dictionary2gether.com
 

Similar to PHP Variables & Comments 01

php 1
php 1php 1
php 1
tumetr1
 
Module-3 15CS71-WTA-Serverside Development with PHP
Module-3 15CS71-WTA-Serverside Development with PHPModule-3 15CS71-WTA-Serverside Development with PHP
Module-3 15CS71-WTA-Serverside Development with PHP
SIVAKUMAR V
 
Php mysql-training online-by_php2ranjan
Php mysql-training online-by_php2ranjanPhp mysql-training online-by_php2ranjan
Php mysql-training online-by_php2ranjan
php2ranjan
 
php training in hyderabad
php training in hyderabadphp training in hyderabad
php training in hyderabad
php2ranjan
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
Francois Zaninotto
 
Extensiones In PHP
Extensiones In PHPExtensiones In PHP
Extensiones In PHP
Roberto Bermejo
 
Chap 4 PHP.pdf
Chap 4 PHP.pdfChap 4 PHP.pdf
Chap 4 PHP.pdf
HASENSEID
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Introduction to-php
Introduction to-phpIntroduction to-php
Introduction to-php
AhmedAElHalimAhmed
 
9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP
Terry Yoast
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
Sumit Biswas
 
PHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web DevelopmentPHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web Development
Edureka!
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto Presentation
Roy Sivan
 
Day1
Day1Day1
Day1
IRWAA LLC
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolment
Rajib Ahmed
 
Php mysql
Php mysqlPhp mysql
Php
PhpPhp
PHP Lesson
PHP LessonPHP Lesson
PHP Lesson
Rithirun Meas
 

Similar to PHP Variables & Comments 01 (20)

php 1
php 1php 1
php 1
 
Module-3 15CS71-WTA-Serverside Development with PHP
Module-3 15CS71-WTA-Serverside Development with PHPModule-3 15CS71-WTA-Serverside Development with PHP
Module-3 15CS71-WTA-Serverside Development with PHP
 
Php mysql-training online-by_php2ranjan
Php mysql-training online-by_php2ranjanPhp mysql-training online-by_php2ranjan
Php mysql-training online-by_php2ranjan
 
php training in hyderabad
php training in hyderabadphp training in hyderabad
php training in hyderabad
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Extensiones In PHP
Extensiones In PHPExtensiones In PHP
Extensiones In PHP
 
Chap 4 PHP.pdf
Chap 4 PHP.pdfChap 4 PHP.pdf
Chap 4 PHP.pdf
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
 
Introduction to-php
Introduction to-phpIntroduction to-php
Introduction to-php
 
9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP
 
Php1
Php1Php1
Php1
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
 
PHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web DevelopmentPHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web Development
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto Presentation
 
Day1
Day1Day1
Day1
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolment
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Php
PhpPhp
Php
 
PHP Lesson
PHP LessonPHP Lesson
PHP Lesson
 

More from Spy Seat

Kazdoura & Luciano Jan – Aug 2016 Cost Analysis
Kazdoura & Luciano  Jan – Aug 2016 Cost AnalysisKazdoura & Luciano  Jan – Aug 2016 Cost Analysis
Kazdoura & Luciano Jan – Aug 2016 Cost Analysis
Spy Seat
 
Software Design
Software DesignSoftware Design
Software Design
Spy Seat
 
Visual Basic 6 Data Base
Visual Basic 6 Data BaseVisual Basic 6 Data Base
Visual Basic 6 Data Base
Spy Seat
 
Visual Basic ADO
Visual Basic ADOVisual Basic ADO
Visual Basic ADO
Spy Seat
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
Spy Seat
 
Create Contacts program with VB.Net
Create Contacts program with VB.NetCreate Contacts program with VB.Net
Create Contacts program with VB.Net
Spy Seat
 
Create Your first website
Create Your first websiteCreate Your first website
Create Your first website
Spy Seat
 
How Computer work
How Computer workHow Computer work
How Computer work
Spy Seat
 
visual basic 6 Add Merlin
visual basic 6 Add Merlin visual basic 6 Add Merlin
visual basic 6 Add Merlin
Spy Seat
 
My Bachelor project slides
My Bachelor project slides My Bachelor project slides
My Bachelor project slides
Spy Seat
 
Difference between asp and php
Difference between asp and phpDifference between asp and php
Difference between asp and php
Spy Seat
 
Error handling
Error handlingError handling
Error handling
Spy Seat
 
I/O PHP Files and classes
I/O PHP Files and classesI/O PHP Files and classes
I/O PHP Files and classes
Spy Seat
 
Php session 3 Important topics
Php session 3 Important topicsPhp session 3 Important topics
Php session 3 Important topics
Spy Seat
 
Notify progresscontrol
Notify progresscontrolNotify progresscontrol
Notify progresscontrolSpy Seat
 
Listbox+checkedlistbox
Listbox+checkedlistboxListbox+checkedlistbox
Listbox+checkedlistboxSpy Seat
 
If then vs select case
If then vs select caseIf then vs select case
If then vs select caseSpy Seat
 
If then vb2010
If then vb2010If then vb2010
If then vb2010Spy Seat
 
Date & time picker
Date & time pickerDate & time picker
Date & time pickerSpy Seat
 

More from Spy Seat (20)

Kazdoura & Luciano Jan – Aug 2016 Cost Analysis
Kazdoura & Luciano  Jan – Aug 2016 Cost AnalysisKazdoura & Luciano  Jan – Aug 2016 Cost Analysis
Kazdoura & Luciano Jan – Aug 2016 Cost Analysis
 
Software Design
Software DesignSoftware Design
Software Design
 
Visual Basic 6 Data Base
Visual Basic 6 Data BaseVisual Basic 6 Data Base
Visual Basic 6 Data Base
 
Visual Basic ADO
Visual Basic ADOVisual Basic ADO
Visual Basic ADO
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
 
Create Contacts program with VB.Net
Create Contacts program with VB.NetCreate Contacts program with VB.Net
Create Contacts program with VB.Net
 
Create Your first website
Create Your first websiteCreate Your first website
Create Your first website
 
How Computer work
How Computer workHow Computer work
How Computer work
 
visual basic 6 Add Merlin
visual basic 6 Add Merlin visual basic 6 Add Merlin
visual basic 6 Add Merlin
 
My Bachelor project slides
My Bachelor project slides My Bachelor project slides
My Bachelor project slides
 
Difference between asp and php
Difference between asp and phpDifference between asp and php
Difference between asp and php
 
Error handling
Error handlingError handling
Error handling
 
I/O PHP Files and classes
I/O PHP Files and classesI/O PHP Files and classes
I/O PHP Files and classes
 
Php session 3 Important topics
Php session 3 Important topicsPhp session 3 Important topics
Php session 3 Important topics
 
Notify progresscontrol
Notify progresscontrolNotify progresscontrol
Notify progresscontrol
 
Listbox+checkedlistbox
Listbox+checkedlistboxListbox+checkedlistbox
Listbox+checkedlistbox
 
If then vs select case
If then vs select caseIf then vs select case
If then vs select case
 
If then vb2010
If then vb2010If then vb2010
If then vb2010
 
For next
For nextFor next
For next
 
Date & time picker
Date & time pickerDate & time picker
Date & time picker
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 

PHP Variables & Comments 01

  • 1. PHP Course PHP is a server scripting language, powerful tool for making dynamic and interactive Web pages.. This presentation provide you with PHP source code and the HTML output of that code………….Enjoy!. PHP Course Info@ITBigDig.com
  • 2. Instructor  Name: Mohamed Saad.  Email: Engsaad_aly@hotmail.com  Occupation: Web Developer In IT Big Dig. PHP Course Info@ITBigDig.com
  • 3. PHP Course 1: Variables & Comments PHP Course Info@ITBigDig.com
  • 4. Naming Rules PHP Course Info@ITBigDig.com • $ sign then Name of the variable. • Begin with a letter or the underscore character. • Name can only contain alpha-numeric characters and underscores. • Name Should not contain spaces. • Variable names are case sensitive. • No command for declaring a variable. Variables
  • 5. Variables Scopes PHP Course Info@ITBigDig.com Global Declared outside of any function. Local Declared within a PHP function can only be accessed within that function Static When a function is completed, all of its variables are normally deleted. However, sometimes you want a local variable to not be deleted. use the static keyword . Parameter A parameter is a local variable whose value is passed to the function by the calling code.
  • 6. Variables Data Types PHP Course Info@ITBigDig.com String Hello Mohamed Saad Integer 48, -5, 160,… Double 2.209, -1.3, 3.14,… Boolean True or False Date 2015-12-31 12:55:22
  • 7. PHP Course Info@itBigDig.com Athematic Operators Operator Name Description A + B Addition Sum of A and B A - B Subtraction Difference of A and B A * B Multiplication Product of A and B A / B Division Quotient of A and B A % B Modulus Remainder of A divided by B A . B Concatenation Concatenate two strings
  • 8. Dreamweaver Create New Site PHP Course Info@itBigDig.com Dreamweaver CS 6
  • 9. Dreamweaver From Site menu Select New Site PHP Course Info@itBigDig.com project Navigate to desktop and create New Folder Dreamweaver CS 6
  • 10. Dreamweaver Configure Your Server PHP Course Info@itBigDig.com Navigate to desktop and create New Folder Dreamweaver CS 6
  • 11. Dreamweaver Configure Your Server PHP Course Info@itBigDig.com Configure your server Dreamweaver CS 6
  • 12. Dreamweaver Configure Your Server Dreamweaver CS 6 PHP Course Info@itBigDig.com Server name any name FTB Address Domain Username FTP User Password FTP Pass Root Folder on your host For this Tutorial I created a Demo folder on my host and we will use it along
  • 13. Dreamweaver Configure Your Server Dreamweaver CS 6 PHP Course Info@itBigDig.com
  • 14. Dreamweaver Rename File: variables.php Dreamweaver CS 6 PHP Course Info@itBigDig.com
  • 15. PHP Tag Open variables.php and insert basic code <?php ?> PHP Course Info@itBigDig.com
  • 16. Copy Code Open variables.php and insert basic code <?php ?> PHP Course Info@itBigDig.com <!DOCTYPE html> <html> <body> <?php ?> </body> </html>
  • 17. PHP String Data Output Data <?php echo “ ”; ?> PHP Course Info@itBigDig.com
  • 18. PHP String Data Store & Output Data <?php $VariableName= „Saad‟ ; ?> PHP Course Info@itBigDig.com
  • 19. PHP String Data Concatenation Operator <?php echo $first . " " . $last ; ?> PHP Course Info@itBigDig.com
  • 20. PHP String Data Get Type Function <?php echo gettype($user); ?> PHP Course Info@itBigDig.com
  • 21. <?php echo strlen($user); ?> PHP Course Info@itBigDig.com PHP String Data String Length Function
  • 22. <?php echo strpos("Hello","H") ?> PHP Course Info@itBigDig.com PHP String Data Search for a text
  • 23. <?php echo chr(65) ?> PHP Course Info@itBigDig.com PHP String Data Character Function
  • 24. <?php echo chr(65) ?> PHP Course Info@itBigDig.com PHP String Data Character Function
  • 25. Comments Insert comments & add remarks to your code. PHP Course Info@ITBigDig.com Single Line • //Comments here Multi Lines • /* Comments here Comments here */
  • 26. Dig …? calculate the Area of square which have the Length of 4 cm. Print the result in • Meter (m). • Centimeter (Cm). • Millimeter (mm). PHP Course Info@ITBigDig.com
  • 28. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Square Area</title> </head> <body> <?php $x=1;//legnth in centimeter echo "Length of the square =$x <br/>";//Print out the length $meter=$x/1000;//legnth in meter $Ameter =$meter*$meter;//Area in meter echo "Area of the square= $Ameter M<sup>2</sup> <br/>"; $Acent = $x*$x;//Area in centimeter echo "Area of the square= $Acent Cm<sup>2</sup> <br/>"; $milli =$x*1000;//legnth in millimeter $Amilli=$milli*$milli;//Area in millimeter echo "Area of the square= $Amilli mm<sup>2</sup>"; ?> </body> </html> PHP Course Info@ITBigDig.com Copy Code
  • 29. We hope You enjoy This Tutorial. For any Suggestions Please email Us Info@ITBigDig.com PHP Course Info@ITBigDig.com End Variables & Comments Itbigdig.com