To learn PHP, our basic requirement is knowledge of HTML ,JAVASCRIPT, and overview of C and C++.
To start php in a code you need to declare <?php
And to end a php code you need to declare ?>
php is very near to basic C language so it is simple to learn. but PHP supports OOPS i.e Object oriented programming.
Main Benefit of PHP is it is an open source and available to all freely.
The basic structure of HTML goes like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <TITLE>Mytitle</TITLE> </HEAD> <BODY> <P>My Content </BODY> </HTML>
when we want to use the php code we can just modify this like
<HTML> <HEAD> <title>Mytitle</title> </HEAD> <BODY> <P> <?php echo "My Content"; ?> </BODY> </HTML>
Now save the file as some "filename.php" and execute the file
in the localhost which would give OUTPUT as below in Browser.
My Content
No comments:
Post a Comment