PHP Tutorial - Introduction
PHP Tutorial - Introduction
Introduction
Welcome to ComLanka.com's PHP Tutorial. The goal of this tutorial is to teach you the basics of PHP so that you can:
- Customize PHP scripts that you download, so that they better fit your needs.
- Create dynamic web pages.
- Begin to understand the working model of PHP, so you may begin to design your own PHP projects.
PHP - What is it?
Taken directly from PHP's home, PHP.net , "PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly."
This is generally a good definition of PHP. However, it is often easier to think of PHP in terms of what it can do for you. PHP will allow you to:
- Reduce the time to create large websites.
- Create a customized user experience for visitors based on information that you have gathered from them.
- Open up thousands of possibilities for online tools. Search in GooGle.com 'PHP script'.
- Allow creation of shopping carts for e-commerce websites.
One of the main strengths of PHP is the fact that because it can be embedded directly alongside HTML code, there is no need to write a program that has many commands just to output the HTML. HTML and PHP can be used interchangeably as needed, working alongside one another in unison. With PHP, we can simply do the following:
<html>
<title><? print "Hello world!"; ?></title>
<body>
<? print "Welcome to PHP world "."<br>" ; ?>
<? print (date("F d, Y")); ?>
</body>
</html>