Introduction to PHP Classes

Since PHP version 5 has been released, it has been improved with Object-Oriented Programming, using classes. It’s one of the most used features in system programming languages like C++ and can now be used in PHP.

In this article I assume you know the following in advance:

– You know what variables are and how to assign values to them in PHP.
– You know what a function is and how it works.

Before I start, I want to tell a bit about functions.

Continue reading

Combining PHP with JavaScript

Using server-side programming languages like PHP and ASP.NET is a great way to build dynamic web pages. Build content on-the-fly or perform database operations. This is usually combined with static HTML documents. But the major disadvantage of server-side scripts is the fact that each user input requires the page to be reloaded (basically needs to be re-parsed by the server-side application). And on the other hand there is JavaScript, which can perform many tasks without requiring a page to be reloaded, as all instructions can be processed directly in the browser.

There’ve been quite some questions about web developers who are wondering if they can combine a server-side programming language like PHP with a client-side programming language like JavaScript to combine the advantages of the two. Well, the answer is Yes. It can be done, and it’s not hard to do either. it just takes a different approach.

Continue reading