PHP Overview - St. Edward's University

Download Report

Transcript PHP Overview - St. Edward's University

PHP Overview
What is PHP
•
•
•
•
•
Widely available scripting language
Free
Alternative to Microsoft’s ASP
Runs on the Web Server; not in the browser
Example:
http://www.w3schools.com/php/showphp
.asp?filename=demo_intro
Variables and Data Types
• Can store text or numeric values in variables
http://www.w3schools.com/php/showphp.asp?f
ilename=demo_var
• Can store Strings, integers, boolean, arrays
objects and null
Operators. If..else..elseif
• Supports operators as in many other
languages, as you would expect
http://www.w3schools.com/php/showphp.asp?f
ilename=demo_oper_addition
http://www.w3schools.com/php/showphp.asp?f
ilename=demo_oper_multiplication
Form Handling
• Handles HTML form submissions very well
• Great for interacting with a database
• Form submissions explained here:
http://www.w3schools.com/php/php_forms.asp
Echo and Print
• echo and print both output data to the screen
• echo can be used without parentheses: echo
or echo()
• Text can contain HTML markup
• Can display the contents of variables
• Tip: Use vardump($foo) when debugging and
you want to know the content of a variable
• See w3Schools for more information