Cleaning Variables in PHP

June 29th, 2014 by Laeeq | No comments

It’s always important to clean/sanitize variables that are submitted via web forms to prevent against all kinds of different malicious threat. Here is a complete function to clean your variables before use Read Full Post »

Parse HTML/Web Pages with PHP

June 5th, 2014 by Laeeq | No comments

Parsing HTML pages is always a challenge for PHP programmers. HTML parsing is done for retrieving images, scraping websites, crawling, error detection websites, and many other useful purposes. But PHP Simple HTML DOM Parser is a awesome or can say dream library for developer that work with both PHP and the DOM element using PHP.

Read Full Post »

Block Multiple IP Addresses Using PHP

May 11th, 2014 by Laeeq | No comments

Sometimes we need to ban particular visitors to access our website. For this, the most common reason is spammers and scrapers that perform malicious activity from few persistent IP addresses. Although there are so many tricks to block multiple IP addresses such as using htaccess, Apache mod_rewrite but here you’ll know the simple trick to block multiple IP addresses using PHP.

Read Full Post »

How much memory do PHP variables use?

April 10th, 2014 by Laeeq | No comments

There are cases when it might be quite important to know how much memory uses each variable in PHP script. The function memory_get_usage returns the amount of memory, in bytes, that’s currently being allocated to your PHP script.

Read Full Post »

Manipulating PHP arrays: push, pop, shift, unshift

April 5th, 2014 by Laeeq | No comments

In spite of allowing direct access to individual array element, PHP also provides various other interesting ways to deal with arrays. In particular, there are functions that make it very easy and efficient to use a PHP array as a stack or as a queue.

Read Full Post »

10 Super Useful PHP Code Snippets

March 22nd, 2014 by Laeeq | No comments

Code snippets are always useful which saves your precious time and also increase productivity. Today, I’m sharing some super useful PHP code snippets that I’ve collected over the past months.

Read Full Post »

Let’s play with php.ini file Configuration

March 21st, 2014 by Laeeq | No comments

Whether you’re novice or experienced PHP programmer, PHP.ini configuration is essential. It’s an important configuration file that is used to customize behaviour of PHP at runtime. When PHP server starts up it looks for PHP.ini file first to load various values for settings.

Read Full Post »

15+ regular expressions for PHP developers

March 5th, 2014 by Laeeq | No comments

Regular expression is really very useful which allows search, validation, finding, identifying or replacing text, words or any kind of characters. Here in this post, I’ve listed 15+ useful PHP regular expressions and functions that might be helpful for any PHP developer.

Read Full Post »

10 Most Important Directory Functions in PHP

February 19th, 2014 by Laeeq | No comments

When writing PHP scripts that need to deal with the file-system to change the current directory, creating new directories, change the root directory, gets the current working directory, list files and directories inside the specified path and many more. For this, PHP provides a number of built-in directory functions that can be used to perform such tasks.

Read Full Post »

Determining variable types in PHP

February 12th, 2014 by Laeeq | No comments

PHP, as most of us know, has weak typing. What this means is that variable types are determined by context. It’s not always obvious what type a given variable is at any one time. It determines the types of variables and converts them as per requirement.

Read Full Post »