I started learning the PHP programming language in 2003.
The official webpage can be found on this website and comes with this intro.
PHP is a popular general-purpose scripting language that is especially suited to web development.
Fast, flexible, and pragmatic, PHP powers everything from your blog to the most popular websites in the world.
To run PHP you need to install a web server, install PHP, and if you want to install a database, such as MySQL to use a database.
Another good solution for learning is online tool editors.
The PHP acronym comes from Personal Home Page.
Historically, the PHP Framework Interop Group (FIG) has created the PHP Standards Recommendation (PSR) documents that have helped bring more standardization to the language since 2009.
The syntax of this programming language is simple.
The PHP processor only parses code within its delimiters allowed by PSR-1 are <?php and ?> or <?= and ?> in order to to separate PHP code from non-PHP data – HTML.
Each line of code needs to be close with a semicolon;
1 2 3 | <?php echo "Hello World!\n"; ?> |
Variables are case-sensitive and are prefixed with a dollar symbol and a type that does not need to be specified in advance.
PHP has hundreds of base functions and thousands more from extensions.
PHP supports true anonymous functions as of version 5.3.
Anonymous functions, also known as closures, allow the creation of functions that have no specified name.
1 2 3 4 5 6 7 8 | <?php $greet = function($name) { printf("Hello %s\r\n", $name); }; $greet('World'); $greet('PHP'); ?> |
The PHP language is an OOP – Object-Oriented programming.
You can see a simple demo example on an online tool created with a simple example.