echo is the most primitive of them, and just outputs the contents following the construct to the screen. print …
Page: PHP
Magic Methods
PHP reserves all function names starting with __ as magical.
__sleep :- This function is executed …
Difference between include and require
It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and …
MySQL Reconnect In PHP
Can use the inbuilt function mysql_ping(), which will check whether or not the connection to the server …
Autoloading Classes In PHP
Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest …
Get File Path Info Using PHP pathinfo Function
The pathinfo file returns the informations about a given path, like filename,basename,extension. No need of playing around with string positions, …
PHP Magic Methods
PHP reserves all function names starting with __ as magical. It is recommended that you do …
http_build_query function usage
Generate URL-encoded query string from an array of argument variables. The separator is & by default and for changing that with …
PDO Connection And DNS Settings For Different Databases.
PDO(PHP Data Objects) is one of main feature of PHP 5.1 to managing databases. It is developed to provide a …
Get Bible Verse of day Using JSON
Following it a simple code snippet with uses JSON (Javascript Object Notation) to fetch the Bible Verse of the Day from …
Extract the strings from source code for Translation (po file)
To extract the strings to be translated from the program source code. This is achieved with xgettext. I think you …
Check if string is UTF-8 encoded
This is_utf8() function is to detect UTF-8 strings, and return a boolean value. The for loop is to go through …
Creates a temporary file with PHP
Creates a temporary file with a unique name in read-write (w+) mode and returns a file handle . The file …
Regular expression for type specifier
We are commonly using type specifiers in PHP. If you want to check for any kind of type specifiers occurrence, …
Simple bot detection with php
Here, I am gonna describe how can we detect the visits of the popular bots with PHP.
Array of some known …
PHP header types
Some of the commonly used PHP header content-types are listed below.
Atom
header(‘Content-type: application/atom+xml’);
Audio
header(‘Content-Type: audio/mpeg’); // mpeg /mp3 files
header(‘Content-Type: audio/x-wav’); // wav …
