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

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Último (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

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