Simple Code for Pagination in PHP

July 3rd, 2015 by Laeeq | No comments

Pagination is an essential part of any web application. It’s a process of dividing large content into small parts and displaying on multiple pages in chunks. When data grows in web applications, it cannot be displayed on a single page as it will create issue like browser hang and long vertical scroll. Read Full Post »

PHP 7 – Expected Features for PHP 7

January 31st, 2015 by Laeeq | No comments

PHP 7, a huge release is due in this year. The PHP 7 will offer reduce memory consumption, performance improvements and more capabilities. After a broad research to improve PHP performance results in a new codebase that is nearly 100% compatible and provides anywhere between 20% and 110% performance gains in real world applications such as WordPress, Drupal or SugarCRM. It also significantly reduces memory consumption. Read Full Post »

How to Remove Leading & Trailing White Spaces with PHP

December 7th, 2014 by Laeeq | No comments

We often need to remove leading and trailing spaces from a user inputted string or when we want to break up a list of items. PHP allows many useful functions to format your strings according to your requirement to automatically remove characters from the beginning and end of a string. Read Full Post »

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 »