Subscribe For Free Updates!

We'll not spam mate! We promise.

Aug 26, 2014

preg_replace to add something after closing tag - PHP

PHP - preg_replace to add something after closing tag : Here i will explain how to add something like string, char (or) any html tag after closing tag. Here we are using preg_replace() function to do it. In the below example, add <br /> tag after closing of all <img> tag. Syntax :     preg_replace('/(<img[^>]+>(?:<\/img>)?)/i',...

Aug 14, 2014

htmlentities() and html_entity_decode() in JQuery

htmlentities() and html_entity_decode() in JQuery : We are all know about use of htmlentities() in PHP. This function is used to convert all character to HTML entities. both function are used to treat string as a html and HTML as a string.        For Example :                  ...

Jun 6, 2014

Redirect with HTTP Status Code - PHP

Redirect with HTTP Status Code - PHP :   Redirect one url to another url using php is simply run with "header ("Location: redirectURL");" . But redirect with HTTP Status Code is more efficient to optimize for search engines.     Here i will explain about php redirect with http status code. These http status code is common for...

Jun 5, 2014

PHP Validate Credit Card Number

PHP Validate Credit Card Number :   Now a days , credit card purchase is happened in many websites. The below php function is used to validate the given credit card number in php. function isCreditCardValid ( $number, $cctype ) {     if ( !is_string ( $number)          || !trim ( $number ) )              return false;            $ccs = array (  ...

May 21, 2014

MySQL query to trim particular character from database column field

MySQL has some default functions to trim particular cahr or whitespaces from all the column field in database rows. MySQL provide four type of methods to trim char. 1. TRIM() 2. TRIM(LEADING) 3. TRIM(BOTH) 4. TRIM(TRAILING) we can use above four methods in select, update and delete queries. 1. TRIM()     TRIM() function is used to remove...

May 20, 2014

Check String contains html tags and count of html tags using PHP

Here i will explain how to check the given string contains html tags or not.  this function return boolean value. // Function for check html tag presents function hasTags($str){  $htmlTags = array('A' ,'B', 'BODY', 'BR', 'BUTTON', 'DIV', 'FONT', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'IMG', 'INPUT', 'TABLE'); // Here you mention what...

Aug 25, 2013

Email validation using JavaScript and Jquery

Email validation using JavaScript and Jquery :  Here i will explain how to validate email id with JQuery. In JavaScript we can check the email id format only. but in jquery we can check whether we allow or not some of domain names also. First i will explain basic javascript method to validate email id. Here is Javascript method : function...

Aug 19, 2013

PHP - Validate Email Id

PHP - Validate Email Id :  Here i will explain how to validate email id in php. This is very use full to validate email id in server side. php is used in server so we can validate email id in server side. if you want to validate email id in client side then you can use JavaScript, jquery etc...  The below example will show you how...