PHP is a popular general-purpose scripting language that is maintained by The PHP Group and is harnessed for web development. It is released under the open source PHP License and its official website is https://www.php.net.
PHP can run on the command line or processed on a web server by an interpreter. As of 2024, PHP releases a minor release that is supported for 2 years and an additional year on only security fixes for a three year life cycle.
A data type is a grouping of data values. Variables are created to store a data type. In PHP, the assigning of a value will indicate the data type. PHP does not require a format specific in order to display the value.
A data type can be changed by assigning a different value. It is also possible to change the data type by casting. To cast a NULL data type, unset must be used.
In this chapter, you will learn about the brief history of PHP, its syntax, comments and string formatting. You can use your favourite text editor, IDE or use the built-in IDE. The built-in IDE can also be used to compile your code.
If you use your own text editor or IDE, you will need to also install PHP in order for your code to be interpreted. The built-in IDE has syntax highlighting using different colours for the keywords, comments, control-flow statements, variables and other elements.
To use the built-in IDE simple type the code in the IDE and click the compile button to display the results in the output area. Otherwise follow the requirements for the text editor and PHP.