IntroductionPHP is a server scripting language, and is a powerful tool for making dynamic and interactive Web pagesquickly.PHP is a efficient alternative to competitors such as Microsoft's ASP.What is PHP?PHP is an acronym for "PHP Hypertext Preprocessor“Hypertext pre-processor - Interpreter of PHP code, processes PHP code invoked by web server and send pure HTML code to browserPHP is a widely-used, open source scripting languagePHP costs nothing, it is free to download and use
IntroductionWhat can PHP do?PHP can generate dynamic page contentPHP can create, open, read, write, and close files on the serverPHP can deals with preservation of state management techniques like cookies, sessionPHP can perform database related operations like add, delete, modify data in your databasePHP can restrict users to access some pages on your websitePHP can encrypt data
FeaturesPHP is free. Download it from the official PHP resource: Platform compatibility . PHP runs on various platforms (Windows, Linux, Unix etc.)Simple syntaxSupports many databases likes mssql , oracle etc..Broad functionality for network connectivity, file system support, COM, XML, Macromedia Flash.A vibrant and supportive community
How php script works?
Example:<html> <title>my php page</title><body> <?php echo "hello there!";?> </body></html>•Echo is a special statement in php for outputing data to the browser.•At the end of each PHP statement we need to put a semicolon, i.e. ";“ which indicate the end of a PHP statement and should never be forgotten.
8HTML in a PHP page<head><title>PHP Info</title><?phpprint("PHP Stats on the Server");?> </head><body><?phpphpinfo();?>And print some more text here!</body></html><script>blockin <head><script>blockin <body>Language we areusing is PHPGenerate HTML“on the fly” withprint(...);
PHP Comments<html><body><?php// This is a single line comment# This is also a single line comment/*This is a multiple lines comment blockthat spans over more thanone line*/?></body></html>
VariableVariables are used for storing values, like text strings, numbers or arrays.All variables in PHP start with a $ sign symbol.A variable name must start with a letter or an underscore "_"A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, and _ )A variable name should not contain spaces. If a variable name is more than one word, it should be separated with an underscore ($my_string), or with capitalization ($myString).
VariablePHP has no command for declaring a variable.