Tag: php tutorial

PHP – An Overview

by
Guru

PHP has been going strong since its very first public release. Today it is among the leading scripting language powering the web; think Google, YouTube, Digg and the likes. You might and might not have got the feeling of dynamism after I have mentioned the previous websites. Yes, you make the ground move. You can turn your old static page into a living one (dynamic), well I am talking about PHP right now. I am not going to bias you into thinking that we have got only PHP for this particular need; we have got asp .net as an example.

PHP is still a young language under under heavy development, with its developers writing and rewriting its core, improving it with each new release. You must be at least aware that we are in the object oriented generation. As from version 4, PHP has object oriented available for you to play with. With now its 5 series it has improved object oriented, but cannot be compared with Java and C++ language object orientation. Yet, it is sufficient for us to write beautifully.

I will now try build up your thinking stream; how you should do it in PHP. ๐Ÿ™‚

PHP can be embedded anywhere in HTML. For instance we can display a simple text using PHP and html. Before going any further, PHP is used for its logical potential as compareds as the HTML counter part which offers us only the “displaying” ability. PHP does all the processing and its end product is some “HTML” that you will use for displaying. I am sure you must have this part right in your head.

<html>
<head>
<title>A simple html and php example</title>
</head>

<body>
Here is a <?php echo ‘simple text’; ?>
</body>

</html>

After running the above snippet in your web server you will have the below html code when viewing its source in your web browser.

<html>
<head>
<title>A simple html and php example</title>
</head>

<body>
Here is a simple text
</body>

</html>

Quite simple? This is the stepping stone. Get the feel of it.

Try to think!!! What will it be like having hundreds of tit bits of php codes in your html. Urhh? Sounds messy? In fact, it becomes real messy. To counter this, you cal use templating engine. May be Smarty? This is the most recommended nowadays. I will talk about it in a later post. ๐Ÿ™‚

Data is something unmissable for most of our websites. We all want a data backbone to play with. MySql? PostgreSql? Oracle? PHP can interface with almost any database server you can think of, urhh?? it can do so too with a simple access database (not a server). Connectors make this possible for us. We don’t need to know the underlying details.

I would recommend you to use MySql as your back-end. Open-source, free and strong going. And, it has made a reputation on the market.

PHP is a loosely typed language, that is it we do not need to strictly declare a variable in our script. We can do so as we go. Sounds good? Yes, but it is disadvantageous. (I will cover it in another post). We can cast from one data type to another. It just happens smoothly and it makes you mad while debugging at times.

PHP does not comes with a predefined security toolkit that you can just use. But, it comes with functions that you can use to build the weapon to fight evilness. ๐Ÿ˜›

We are given even more flexibility, weย  can break down our code into its very own sub modules and include them together to make the whole “thing” or even put it anywhere we want it to.

I guess I have been able to try to build up a new thinking stream. Where you should maybe be heading. We will next be talking about syntax in my post.

In short PHP is a hot enough scripting language to mess with. It is your choice to love or hate it. Keep the reason(s) to yourself.