Programming

static and self: weird behaviour or not


Posted on July 01, 2016 at 18:00 PM


Reading the code below, what do you think it will be the output? It has been tested using PHP 5.5.30. error_reporting(E_ALL & ~E_STRICT); class ClassTarget { private static $propertyA = 1; public function getStatic()…

Read More

Comparing variables in PHP


Posted on December 13, 2014 at 00:00 AM


In general it isn't a best practice to compare apples with nuts. But if you really want to do this, you can, but this doesn't mean that you will get the same result as another person would expect to. The same problem…

Read More

isset() && !empty()


Posted on November 24, 2014 at 10:00 AM


When I have found the first time this condition: isset($var) && !empty($var) (that was a few years ago), it put me a little bit to think. It didn't cross my mind to use this condition and I was wondering what…

Read More

How to? - Process a form using PHP (OOP style)


Posted on August 06, 2014 at 13:20 PM


In this post I'll show you how you can transform some procedural code into an OOP code in PHP. What OOP code means? Well, instead of using procedural PHP and some collections of functions (predefined or user-defined),…

Read More

How to? - Process a form using PHP (procedural style)


Posted on July 07, 2014 at 22:40 PM


Today I'll show you how can you use the information that a user sends you using a HTML form. Let's suppose we have a registration form and we want to save the data into a users table with the following structure: id,…

Read More

How to? - My first script using WAMP server and PHP


Posted on June 30, 2014 at 01:00 AM


Because a promise is a promise, here is the first post of a long list on the "PHP - How to?" series. I don't want to scare you so I start with a very easy example: code your first PHP script using PHP and WAMP server.…

Read More

Installing PEAR on WAMP Server


Posted on May 27, 2014 at 08:55 AM


I was curious to see how can I use PEAR packages with a PHP application so I installed PEAR on my WAMP server which was very easy. The hard part was to make it work that's way I'm writting  this post to present you…

Read More

Design Patterns Part III – Observer


Posted on April 01, 2014 at 16:00 PM


The problem: Well, this is my favorite. Why? Because get you free of a lot of responsabilities. Let me explain: suppose you have an online newspaper website and for publishing an article you must follow these steps:…

Read More

Design Patterns Part II – Factory


Posted on April 01, 2014 at 16:00 PM


The problem: We need a method that could generate us different “products” based on different conditions or, why not, depending on the context. If we didn’t know about design patterns we would solve this by creating…

Read More

Securing PHP applications Part I – Securing PHP code


Posted on March 20, 2014 at 17:20 PM


There are a lot of books treating this issue. So, why another post about this subject. Well, here a try to cover this problem in a short way so that you don’t have to read hundreds of pages or to search all over the…

Read More

Blog Search

Popular Blog Categories

Newsletter

Want to be informed about latest posts? Subscribe to our newsletter