Cool Ajax - Web Development Tutorial Blog

Category : Quick Tips

Simple trick to extract substrings from a string

Sometimes we need to extract a substring from a long string. Php provide a very flexible and powerful substr()function that allows you to extract a substring from a larger string. It takes three parameters: the string to be worked on, a starting index and an optional length. The starting index can be specified as either a positive integer that means [...]

CSS Fixed Footer Support All Browser

Fixed footer can play important role of any website. We show our copyright text in footer and sometimes also show sponsor advertisement in footer section. If we make our footer fixed then visitors can see footer content while they scrolling page details. I’ve tested following snippet in all major web browsers including mobile browsers and it’s working great. So, today [...]

Quick drop down list with 250 countries

Country lists is one of the most common element in web form. Suppose you have a registration form, but no country drop down list! Then it seems incomplete form. But to get user country name from a country list drop down box, you may need to write 250+ option tag in your form element. which is much more boring and painful. To [...]

Quickway to find max and min value from an array

There are lot of techniques to find max and min value from an array. But today I’m going to show an Quick way to find max and min value from an array. Hope you like it. First we take a list of numbers in an array. Then sort array list using PHP sort() function. To take minimum value we need [...]

Convert Color code from HEX to RGB using PHP

Hello friends, today I’m going to show you a cool function to convert color code from HEX to RGB. Well, most of the time we use directly color text like “red”,”green”,”yellow” and sometimes we uses color HEX code like “#FFFFFF” for white or “#0000000” for black. But If you want to use opacity property for text-shadow or box shadow then [...]

Quick Tips to know about mysql server Timezone

Last day worked in a project and I required to know what is my current PhpMyAdmin (mysql) server timezone. It’s really very important while you are working on a application that worked based on user timezone. So, we need to know SQL server timezone to adjust our server date and time with user local devices date and time. It’s very [...]

How to active CURL in localhost

Most of the them we faced issue with curl function while we working in localhost. Basically, when we install local server in our machine then CURL function set as inactive. That’s why it show an error message because local server can’t initiate curl function. But we can active curl in localhost very easily. Follow the steps. Step: 01 Go to [...]

How to get user timezone using javascript

How to get user timezone using javascript: Time zone setup is very useful, while you are working in a project for different countries. Last day worked such a project and had faced big issue on how to get user timezone using JavaScript. It’s very simple and easy to find out user time zone and manipulate your data according to time [...]

How To Allow Only Google Yahoo MSN bots

For getting index fast in various kind of search engine it’s very important to allow them in your website. Today we are going to learn how to allow them with just few lines of code.Lets get started- Open a robot.txt file and write followint code. This code allow only google, yahoo, msn bots crawling of your web contents. You need [...]

2 ways of printing an array in php

We use echo statement in PHP to output the value of an expression like a single variable. While echo is much more useful, but it’s have some limitation to print array contents. For example, while debugging a script, we needs to see not just the value of an expression, but also its type and it’s index information. So, this type [...]