SlideShare a Scribd company logo
Server Side Scripting Language
10/29/2019By Girmachew Gulint (Mtech CSE) 1
A typical web server today contains four elements
in addition to the physical hardware.
LAMP (Linux, Apache, MySQL, and PHP)
WAMP (Windows, Apache, MySQL, & PHP)
XAMPP (Apache, MariaDB , Perl and PHP)
 PHP
 ASP
 Perl
PHP( Personal Home Page/Hypertext Preprocessor )
• Created in 1994 at the hands of Rasmus Lerdorf.
• a server-side language, which means it runs on the server before anything is sent to
the user’s computer.
Some advantages of server-side language
• Code is hidden from the user
• Secure what is take place in the background
• Reduce users computer load even through it needs powerful server.
10/29/2019By Girmachew Gulint (Mtech CSE) 2
WHY PHP
• PHP runs on numerous, varying platforms, including Windows, Linux, Unix, Mac
OS X, and so on.
• PHP is compatible with almost any modern server, such as Apache, IIS, and more.
• PHP supports a wide range of databases.
• PHP is free!
• PHP is easy to learn and runs efficiently on the server side.
• PHP is faster than other scripting language e.g. asp and jsp.
10/29/2019By Girmachew Gulint (Mtech CSE) 3
Syntax
Tag style Starting tag Ending tag
Standard <?php ?>
Short hand <? ?>
ASP <% %>
Script <script language=“php> </script>
10/29/2019By Girmachew Gulint (Mtech CSE) 4
php can be saved .php or embeded into html.
Example
• <?php
• echo “Hello world”;
• ?>
10/29/2019By Girmachew Gulint (Mtech CSE) 5
• <?
• echo “Hello world”;
• ?>
• <%
• echo “Hello world”;
• %>
PHP-Errors
1. Notice: noticing the programmer.
2. Warning : something has gone wrong during the execution of a script.
3. Error : unrecoverable(execution will stop); typically parsing error like
missing semicolon, function or other problem the engine does not know
how to resolve. Another category of error is logical error.
10/29/2019By Girmachew Gulint (Mtech CSE) 6
Send output to the browser
With PHP, there are two basic ways to get output: echo and print.
1. echo;
2. print();
• The differences : echo has no return value while print has a return value of
1 so it can be used in expressions.
• echo can take multiple parameters (although such usage is rare) while print
can take one argument. echo is marginally faster than print.
10/29/2019By Girmachew Gulint (Mtech CSE) 7
Comment
1. // single line comment
2. # this is also single line comment
3. /* multi line comment */
10/29/2019By Girmachew Gulint (Mtech CSE) 8
Variables
• Are special container of user defined values. Values can be number, string or
Boolean or other.
• Variables use to create template for operation.
• Variable consist name of your choosing preceded by $. (meaningful)
• Variable name can include letter, number and underscore but not include
space
• Variable must start by underscore or letter only
10/29/2019By Girmachew Gulint (Mtech CSE) 9
Example
Good variable Bad variable
$name $1name
$age $+age
$firstName $first name
$_salary $1a2a3a
10/29/2019By Girmachew Gulint (Mtech CSE) 10
Availability of variables
1. Local : their life time is inside function only.
2. global/ superglobal : accessible globally or superglobally.
10/29/2019By Girmachew Gulint (Mtech CSE) 11
Data types
• Different types of data take up different amounts of memory and may be
treated differently when they are manipulated in a script.
• Some programming languages therefore demand that the programmer
declare in advance which type of data a variable will contain. By contrast,
PHP is loosely typed, meaning that it will calculate data types as data is
assigned to each variable.
10/29/2019By Girmachew Gulint (Mtech CSE) 12
Continued
PHP supports 8 primitive data types that can be categorized further in 3 types:
• Scalar Types
• Compound Types
• Special Types
10/29/2019By Girmachew Gulint (Mtech CSE) 13
Data types
Scala data types Compound data types Special data types
Boolean Array Resource
Integer Object Null
Float
Double
String
10/29/2019By Girmachew Gulint (Mtech CSE) 14
gettype() and settype() or casting
• $name = “Girmachew “;
• gettype($name);// will output String
• //casting data type
• $number = 4.5;
• echo gettype($number);
• settype($number, 'string'); // converting into string
• echo gettype($number);
10/29/2019By Girmachew Gulint (Mtech CSE) 15
Constant
PHP constants are name or identifier that can't be changed during the
execution of the script. PHP constants can be defined by 2 ways:
• Using define() function
• Using const keyword
• PHP constants follow the same PHP variable rules. For example, it can be
started with letter or underscore only.
• Conventionally, PHP constants should be defined in uppercase letters.
10/29/2019By Girmachew Gulint (Mtech CSE) 16
PHP constant: define()
• Let's see the syntax of define() function in PHP.
define(name, value, case-insensitive)
Example
• <?php
• define("MESSAGE","Hello JavaTpoint PHP");
• echo MESSAGE;
• ?>
10/29/2019By Girmachew Gulint (Mtech CSE) 17
PHP constant: const keyword
• The const keyword defines constants at compile time. It is a language construct not a function.
• It is bit faster than define().
• It is always case sensitive.
• Example
• <?php
• const MESSAGE="Hello const by JavaTpoint PHP";
• echo MESSAGE;
• ?>
10/29/2019By Girmachew Gulint (Mtech CSE) 18

More Related Content

Similar to Server side scripting language

Introduction to webprogramming using PHP and MySQL
Introduction to webprogramming using PHP and MySQLIntroduction to webprogramming using PHP and MySQL
Introduction to webprogramming using PHP and MySQL
anand raj
 
Basics PHP
Basics PHPBasics PHP
Compiler design
Compiler designCompiler design
Compiler design
Thakur Ganeshsingh Thakur
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
SingleStore
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Introduction to PHP.pptx
Introduction to PHP.pptxIntroduction to PHP.pptx
Introduction to PHP.pptx
SherinRappai
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
ADARSH BHATT
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
Wim Godden
 
02 intro
02   intro02   intro
02 intro
babak mehrabi
 
Php intro
Php introPhp intro
Php intro
sana mateen
 
Guidelines php 8 gig
Guidelines php 8 gigGuidelines php 8 gig
Guidelines php 8 gig
Ditinus Technology Pvt LTD
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
justmeanscsr
 

Similar to Server side scripting language (20)

Introduction to webprogramming using PHP and MySQL
Introduction to webprogramming using PHP and MySQLIntroduction to webprogramming using PHP and MySQL
Introduction to webprogramming using PHP and MySQL
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Compiler design
Compiler designCompiler design
Compiler design
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Introduction to PHP.pptx
Introduction to PHP.pptxIntroduction to PHP.pptx
Introduction to PHP.pptx
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
02 intro
02   intro02   intro
02 intro
 
Php intro
Php introPhp intro
Php intro
 
Guidelines php 8 gig
Guidelines php 8 gigGuidelines php 8 gig
Guidelines php 8 gig
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 

Recently uploaded

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 

Recently uploaded (20)

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 

Server side scripting language

  • 1. Server Side Scripting Language 10/29/2019By Girmachew Gulint (Mtech CSE) 1 A typical web server today contains four elements in addition to the physical hardware. LAMP (Linux, Apache, MySQL, and PHP) WAMP (Windows, Apache, MySQL, & PHP) XAMPP (Apache, MariaDB , Perl and PHP)  PHP  ASP  Perl
  • 2. PHP( Personal Home Page/Hypertext Preprocessor ) • Created in 1994 at the hands of Rasmus Lerdorf. • a server-side language, which means it runs on the server before anything is sent to the user’s computer. Some advantages of server-side language • Code is hidden from the user • Secure what is take place in the background • Reduce users computer load even through it needs powerful server. 10/29/2019By Girmachew Gulint (Mtech CSE) 2
  • 3. WHY PHP • PHP runs on numerous, varying platforms, including Windows, Linux, Unix, Mac OS X, and so on. • PHP is compatible with almost any modern server, such as Apache, IIS, and more. • PHP supports a wide range of databases. • PHP is free! • PHP is easy to learn and runs efficiently on the server side. • PHP is faster than other scripting language e.g. asp and jsp. 10/29/2019By Girmachew Gulint (Mtech CSE) 3
  • 4. Syntax Tag style Starting tag Ending tag Standard <?php ?> Short hand <? ?> ASP <% %> Script <script language=“php> </script> 10/29/2019By Girmachew Gulint (Mtech CSE) 4 php can be saved .php or embeded into html.
  • 5. Example • <?php • echo “Hello world”; • ?> 10/29/2019By Girmachew Gulint (Mtech CSE) 5 • <? • echo “Hello world”; • ?> • <% • echo “Hello world”; • %>
  • 6. PHP-Errors 1. Notice: noticing the programmer. 2. Warning : something has gone wrong during the execution of a script. 3. Error : unrecoverable(execution will stop); typically parsing error like missing semicolon, function or other problem the engine does not know how to resolve. Another category of error is logical error. 10/29/2019By Girmachew Gulint (Mtech CSE) 6
  • 7. Send output to the browser With PHP, there are two basic ways to get output: echo and print. 1. echo; 2. print(); • The differences : echo has no return value while print has a return value of 1 so it can be used in expressions. • echo can take multiple parameters (although such usage is rare) while print can take one argument. echo is marginally faster than print. 10/29/2019By Girmachew Gulint (Mtech CSE) 7
  • 8. Comment 1. // single line comment 2. # this is also single line comment 3. /* multi line comment */ 10/29/2019By Girmachew Gulint (Mtech CSE) 8
  • 9. Variables • Are special container of user defined values. Values can be number, string or Boolean or other. • Variables use to create template for operation. • Variable consist name of your choosing preceded by $. (meaningful) • Variable name can include letter, number and underscore but not include space • Variable must start by underscore or letter only 10/29/2019By Girmachew Gulint (Mtech CSE) 9
  • 10. Example Good variable Bad variable $name $1name $age $+age $firstName $first name $_salary $1a2a3a 10/29/2019By Girmachew Gulint (Mtech CSE) 10
  • 11. Availability of variables 1. Local : their life time is inside function only. 2. global/ superglobal : accessible globally or superglobally. 10/29/2019By Girmachew Gulint (Mtech CSE) 11
  • 12. Data types • Different types of data take up different amounts of memory and may be treated differently when they are manipulated in a script. • Some programming languages therefore demand that the programmer declare in advance which type of data a variable will contain. By contrast, PHP is loosely typed, meaning that it will calculate data types as data is assigned to each variable. 10/29/2019By Girmachew Gulint (Mtech CSE) 12
  • 13. Continued PHP supports 8 primitive data types that can be categorized further in 3 types: • Scalar Types • Compound Types • Special Types 10/29/2019By Girmachew Gulint (Mtech CSE) 13
  • 14. Data types Scala data types Compound data types Special data types Boolean Array Resource Integer Object Null Float Double String 10/29/2019By Girmachew Gulint (Mtech CSE) 14
  • 15. gettype() and settype() or casting • $name = “Girmachew “; • gettype($name);// will output String • //casting data type • $number = 4.5; • echo gettype($number); • settype($number, 'string'); // converting into string • echo gettype($number); 10/29/2019By Girmachew Gulint (Mtech CSE) 15
  • 16. Constant PHP constants are name or identifier that can't be changed during the execution of the script. PHP constants can be defined by 2 ways: • Using define() function • Using const keyword • PHP constants follow the same PHP variable rules. For example, it can be started with letter or underscore only. • Conventionally, PHP constants should be defined in uppercase letters. 10/29/2019By Girmachew Gulint (Mtech CSE) 16
  • 17. PHP constant: define() • Let's see the syntax of define() function in PHP. define(name, value, case-insensitive) Example • <?php • define("MESSAGE","Hello JavaTpoint PHP"); • echo MESSAGE; • ?> 10/29/2019By Girmachew Gulint (Mtech CSE) 17
  • 18. PHP constant: const keyword • The const keyword defines constants at compile time. It is a language construct not a function. • It is bit faster than define(). • It is always case sensitive. • Example • <?php • const MESSAGE="Hello const by JavaTpoint PHP"; • echo MESSAGE; • ?> 10/29/2019By Girmachew Gulint (Mtech CSE) 18