How to RUN PHP Code
How to use XAMPP to run PHP code
A PHP file typically contains HTML tags as well as PHP scripting code. A simple PHP example is quite simple to make. To do so, make a file and fill it with HTML tags and PHP code, then save it with the.php extension.
Note that all PHP statements terminate in a semicolon (;).
The php tag contains all PHP code. It begins with? and ends with php? >. The PHP tag syntax is as follows:
Let's look at a simple PHP example where we use the PHP echo command to write some text.
Output:
Hello First PHP
How to use XAMPP to run PHP scripts
PHP is a common backend programming language that can be run with XAMPP. PHP scripts can be written with any text editor, including Notepad++, Dreamweaver, and others. These programs save as filename.php in the htdocs folder, with the.php extension.
For instance, p1.php.
Because I'm using Windows, my XAMPP server is located on the C drive. As a result, the htdocs directory will be "C:\xampp\htdocs".
PHP Case Sensitivity
Keywords (such as echo, if, else, while), functions, user-defined functions, and classes are case-insensitive in PHP. All variable names, however, are case-sensitive.
You can see that all three echo statements are equal and legitimate in the example below:
Output:
Take a look at the example below to see how variable names are case sensitive. Only the second statement in the example below will display the value of the $color variable. Because $color, $ColoR, and $COLOR are all treated as three separate variables:
Output:
Mga Komento
Mag-post ng isang Komento