PHP difference between single-quoted and double-quoted strings/arrays

February 13, 2014

1.Single quoted strings will display things almost completely “as is.” Variables and most escape sequences will not be interpreted. The exception is that to display a literal single quote, you can escape it with a back slash \’, and to display a back slash, you can escape it with another backslash \\ (So yes, even […]

PHP convert an object to an array

February 13, 2014

For single dimensional array (array) $object works fine. Multi dimension object to array consist of private and protected members. Example single dimensional: All objects to converted to associative arrays: Reference from here

PHP check whether image exists on remote URL

February 12, 2014

The simplest and fastest way is to use curl if your host supports curl.

PHP check if a url is valid using filter_var

February 12, 2014

URL can simply validate use FILTER_VALIDATE_URL in filter_var(). For example: IT can be in a function:

PHP – How to check if variable is an array?

February 12, 2014

PHP has an internal variables handling functions to finds whether a variables is an array Another fastest way of determining an array is by: Cast the value to an array, then check using (===) if it is identical to the original.

MySql query ORDER BY two columns

January 24, 2014

You can order by multiple columns in mysql. The first order take first preference and then second one get next preference in mysql. Example: Statement lik: will sort both columns descending. If specified each column ASC or DESC, first order will take first preference and then second one get next preference in mysql

jquery add overlay layer to a div or body

January 21, 2014

First create the css properties for the overlay layer:  

PHP obfuscated or hide part of the email address

January 17, 2014

I wrote my own function for one of the project to display first 3 characters and last characters before the @. In between the first and last 3 characters, put in 3 star (*). So, this is how it looks like

How to prevent single words or long URL’s From Breaking Out of Container

January 17, 2014

Css try: word-wrap: break-word; For more robust browser support: -ms-word-break: break-all; word-break: break-all; /* Non standard for webkit */ word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto;

jQuery datePicker enable select past dates

January 14, 2014

How to enable the past dates of jQuery inline datePicker? You need to make sure that the minDate option is null. example: Full example: