SlideShare uma empresa Scribd logo
1 de 21
PHP Definition:   PHP stands for Personal Home Page. The PHP Hypertext Preprocessor allows web developers to create dynamic content that interacts with databases. PHP applications are normally found on Linux servers and in conjunction with MySQL databases. It provides those servers with functionality similar to that provided to the Windows platform by Active Server Pages technology.
PHP statements must be inside of PHP tags to be processed by the PHP interpreter. Each PHP statement must end with a semi-colon, which tells the PHP interpreter that the statement is complete. If a semi-colon does not appear at the end of a line, the interpreter will assume that the statement continues onto the next line.
The PHP interpreter condenses all sequential whitespace in PHP scripts to a single whitespace. This convenient feature allows PHP developers to structure their code in a readable format without being concerned about the effects of line breaks and tabs.
COMMENTS PHP has two forms of comments: * Single-line comments begin with a double slash (//). * Multi-line comments begin with "/*" and end with "*/".
SYNTAX // This is a single-line comment /* This is a multi-line comment. */
PHP FUNCTION There are literally hundreds of built-in PHP functions that do everything from returning the current date and time on the server to pulling data out of a database. A function might take zero arguments (e.g, phpinfo(), which returns information on the PHP environment) or it might take several arguments
SYNTAX The syntax for calling a function is straightforward: Syntax: function_name(arguments);
SAMPLE CODE PhpBasics/Demos/PhpInfo.php <html> <head> <title>PHPINFO</title> </head> <body> <?php //Output information on the PHP environment phpinfo(); ?> </body> </html>
PHP OPERATOR Mathematical Operators Operator Name.  Example: Addition + $a + $b Subtraction - $a - $b
Multiplication * $a * $b Division  / $a / $b Modulus % $a % $b
String Operators Operator Name  Example . Concatenation  $a . $b 'Hello' . ' world!'
Assignment Operators Operator Name Example  = Assignment  $a = 1; $c = 'Hello' . ' world!'; += -= *= /= %= .=
Combination Assignment   $a += 1; $a -= 1; $a *= 2; $a /= 2; $a %= 2; $a .= ' world!';
Increment By One ++ $a++; ++$a; Decrement By One -- $a--; --$a;
Other Operators Operator Name Example Ternary   ?: $foo = ($age >= 18) ? 'adult' : 'child'; Error Suppression   @ Creating Dynamic Pages $a = @(1/0);
SAMPLE CODE: <html> <head> <title>Hello World!</title> </head> <body> <?php //Write out Hello World! echo 'Hello World!'; ?> </body> </html> PHP.NET
BASIC PHP SYNTAX PHP Tags: PHP code must be contained in special tags so that the PHP interpreter can identify it. Depending on the PHP configuration, these tags can take several forms: < ?php PHP CODE GOES IN HERE ?>
This is the most commonly used (and recommended) form. It is known as the XML style, because it can be used inside of an XML document without causing the document to become poorly formed. <script language=&quot;php&quot;> PHP CODE GOES IN HERE </script>
Less is more.  The shortest and easiest way to deal with the xml tag problem assuming short tags is enabled and you don't care to listen to people who want you to always use the full php tag is this: <<??>?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>
you also can use this kind of syntax: <?php if( condition ): ?>    <?php else: ?>    <?php endif; ?>
<? PHP CODE GOES HERE ?> &quot;Short&quot; tags. <% PHP CODE GOES HERE %>  HTML STYLE TAG

Mais conteúdo relacionado

Mais procurados (18)

PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Php1
Php1Php1
Php1
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
PHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP ServerPHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP Server
 
Php1
Php1Php1
Php1
 
php
phpphp
php
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
Apache web service
Apache web serviceApache web service
Apache web service
 
PHP presentation - Com 585
PHP presentation - Com 585PHP presentation - Com 585
PHP presentation - Com 585
 
Php ppt
Php pptPhp ppt
Php ppt
 
Apache
ApacheApache
Apache
 
Apache
ApacheApache
Apache
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
 
Apache web server
Apache web serverApache web server
Apache web server
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
 

Semelhante a PHP Definition (38

Semelhante a PHP Definition (38 (20)

Php1
Php1Php1
Php1
 
Php1
Php1Php1
Php1
 
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
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Php intro
Php introPhp intro
Php intro
 
IT Club @ NCP - PHP Workshop May 10, 2011
IT Club @ NCP - PHP Workshop May 10, 2011IT Club @ NCP - PHP Workshop May 10, 2011
IT Club @ NCP - PHP Workshop May 10, 2011
 
Php
PhpPhp
Php
 
PHP.docx
PHP.docxPHP.docx
PHP.docx
 
Php1(2)
Php1(2)Php1(2)
Php1(2)
 
php basics
php basicsphp basics
php basics
 
PHP
PHPPHP
PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Article 01 What Is Php
Article 01   What Is PhpArticle 01   What Is Php
Article 01 What Is Php
 
Phpwebdevelping
PhpwebdevelpingPhpwebdevelping
Phpwebdevelping
 

Último

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Último (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

PHP Definition (38

  • 1. PHP Definition: PHP stands for Personal Home Page. The PHP Hypertext Preprocessor allows web developers to create dynamic content that interacts with databases. PHP applications are normally found on Linux servers and in conjunction with MySQL databases. It provides those servers with functionality similar to that provided to the Windows platform by Active Server Pages technology.
  • 2. PHP statements must be inside of PHP tags to be processed by the PHP interpreter. Each PHP statement must end with a semi-colon, which tells the PHP interpreter that the statement is complete. If a semi-colon does not appear at the end of a line, the interpreter will assume that the statement continues onto the next line.
  • 3. The PHP interpreter condenses all sequential whitespace in PHP scripts to a single whitespace. This convenient feature allows PHP developers to structure their code in a readable format without being concerned about the effects of line breaks and tabs.
  • 4. COMMENTS PHP has two forms of comments: * Single-line comments begin with a double slash (//). * Multi-line comments begin with &quot;/*&quot; and end with &quot;*/&quot;.
  • 5. SYNTAX // This is a single-line comment /* This is a multi-line comment. */
  • 6. PHP FUNCTION There are literally hundreds of built-in PHP functions that do everything from returning the current date and time on the server to pulling data out of a database. A function might take zero arguments (e.g, phpinfo(), which returns information on the PHP environment) or it might take several arguments
  • 7. SYNTAX The syntax for calling a function is straightforward: Syntax: function_name(arguments);
  • 8. SAMPLE CODE PhpBasics/Demos/PhpInfo.php <html> <head> <title>PHPINFO</title> </head> <body> <?php //Output information on the PHP environment phpinfo(); ?> </body> </html>
  • 9. PHP OPERATOR Mathematical Operators Operator Name. Example: Addition + $a + $b Subtraction - $a - $b
  • 10. Multiplication * $a * $b Division / $a / $b Modulus % $a % $b
  • 11. String Operators Operator Name Example . Concatenation $a . $b 'Hello' . ' world!'
  • 12. Assignment Operators Operator Name Example = Assignment $a = 1; $c = 'Hello' . ' world!'; += -= *= /= %= .=
  • 13. Combination Assignment $a += 1; $a -= 1; $a *= 2; $a /= 2; $a %= 2; $a .= ' world!';
  • 14. Increment By One ++ $a++; ++$a; Decrement By One -- $a--; --$a;
  • 15. Other Operators Operator Name Example Ternary ?: $foo = ($age >= 18) ? 'adult' : 'child'; Error Suppression @ Creating Dynamic Pages $a = @(1/0);
  • 16. SAMPLE CODE: <html> <head> <title>Hello World!</title> </head> <body> <?php //Write out Hello World! echo 'Hello World!'; ?> </body> </html> PHP.NET
  • 17. BASIC PHP SYNTAX PHP Tags: PHP code must be contained in special tags so that the PHP interpreter can identify it. Depending on the PHP configuration, these tags can take several forms: < ?php PHP CODE GOES IN HERE ?>
  • 18. This is the most commonly used (and recommended) form. It is known as the XML style, because it can be used inside of an XML document without causing the document to become poorly formed. <script language=&quot;php&quot;> PHP CODE GOES IN HERE </script>
  • 19. Less is more.  The shortest and easiest way to deal with the xml tag problem assuming short tags is enabled and you don't care to listen to people who want you to always use the full php tag is this: <<??>?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>
  • 20. you also can use this kind of syntax: <?php if( condition ): ?>   <?php else: ?>   <?php endif; ?>
  • 21. <? PHP CODE GOES HERE ?> &quot;Short&quot; tags. <% PHP CODE GOES HERE %> HTML STYLE TAG