Category Archives: PHP

“Longer Common SubString Problem” PHP Implementation

The longest common substring problem is to find the longest string (or strings) that is a substring (or are substrings) of two or more strings. The problem of longest common subsequence arises whenever we search for similarities across multiple texts. A particularly important application is in finding a consensus among DNA sequences. The genes for [...]

How to create Daemons in PHP

What is a Daemon? In Unix and other computer multitasking operating systems, a daemon is a computer program that runs in the background, rather than under the direct control of a user; they are usually initiated as background processes. Typically daemons have names that end with the letter “d”: for example, syslogd, the daemon that [...]

PHP functions in Javascript

I like javascript, but I spend too much time wrting some functions just to use it more than once.  In most cases I uses prototype.js to create a shorter code but still being long. Recently I was porting some basic php functions to javascript like  isset(), array_keys(), in_array(), explode() and many more. I was very [...]

Detecting visitors language using PHP

Sometimes we have to create web sites or web applications that must be translated into different languages according to user settings. If we are using PHP this goal is very easy. PHP have predefined variables like $_POST, $_GET, $_SESSION and more. One of this variables is $_SERVER that is an array containing information such as [...]

Detect Mobile Browsers using PHP

Detecting web browsers with php is very easy. To detect the browser itselft we can use the predefined variable: $_SERVER. This is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. To get the browser we just need to check the $_SERVER['HTTP_USER_AGENT'] [...]