The PHP Stands for Hypertext Pre-processor. PHP is a programming language that allows web developers to create dynamic content that interacts with databases.
PHP is basically used for developing web based software applications. PHP is probably the most popular scripting language on the web. It is used to enhance web pages.
PHP is known as server-sided language. That is because the PHP dosen't get executed on the client's computer, but on the computer the user had requested the page from. The results are then handed over to client, and then displayed in the browser.
A PHP script starts with the <? php and ends with the ?> tag.
<?php // Some code to be executed echo "Hello, world!"; ?>
When the client request a PHP page residing on the server, The server first performs the operations mentioned by the PHP code of the page. Then is sends the output of the PHP page in HTML format.
So when the user views the source code of the page, it will be full of HTML tags. All the work is done at the server side.
<?php $string = 'cup'; $name = 'coffee'; $str = 'This is a $string with my $name in it.'; echo $str. "\n"; eval("\$str = \"$str\";"); echo $str. "\n"; ?>
This is a $string with my $name in it. This is a cup with my coffee in it.