Finding Even or Odd numbers - PHP Bitwise
PHP does not provide any mathematical function like is_even to help you check if a given integer is an Even number or Odd. Writing your own such function is not difficult and below are listed a number...
View ArticleImplementing logical right shifting - PHP Bitwise
PHP implements Arithmetic Bit Shifting. This means, for left shifts that use << bitwise operator, bits shifted off the left end are discarded, and zeros are shifted in on the right end of the...
View ArticleGetting Red-Green-Blue from Hexadecimal Colors with PHP
When working with CSS, it is common to use Hexadecimal Notation of colors, while on the back end, many PHP functions (like imagecolorallocate, imagecolorclosest, imagecolorexact etc, require that you...
View ArticleReplace last occurance of a String - PHP
Replacing part of a string with another string is straight forward, but what if you have to replace last occurrence of a character or string with another string. Here is the fastest way to do this.
View ArticleImplementing QuickSort in PHP
Quicksort is practically the fastest way to sort an array of data. PHP's array sorting function sort() uses QuickSort.
View ArticleInsecure PHP Constants and Variables
PHP Constants and Variables can be Insecure if not used properly. This is because of bad coding practices and loose error reporting in development.
View ArticlePortable UTF8 - Unicode Library for PHP
Portable UTF-8 is a library that enables Unicode support in PHP applications. It is written in PHP and does not need mbstring, iconv, UTF-8 enabled PCRE or any other library. The benefit of Portable...
View ArticlePortable UTF8 - Demo
This demonstrated how to use Portable UTF8 library. UTF-8 encoded characters are multi-byte characters that take variable number of bytes - between 1 and 4. This affects all basic to advance string...
View Articledir_callback - Lets play with Directories (PHP)
PHP provides some handy functions for file handling, but to deal with directories, it does not provide much. It has basic directory functions and a directory iterator, but does not cover directory...
View ArticleBest Online Code Sharing Tools
Here is a large collection of code snippet sharing websites.
View ArticlePortable UTF-8 v 1.2 released
I have just uploaded the next version of the Portable UTF-8 library. This version adds 9 UTF-8 string functions to the library. There are a few bug fixes, and also some performance optimizations, but...
View Article