url = "/property/realestate_statistics/";	
	
	lngCityId = $('#cboCityName').val();
	
        $.post(
	  url,
	  {
	   "act" 		: "GetCommonLocation",
	   "CityId" 		: lngCityId
	  },
	  function(responseText){		
	   $('#cboLocation').html(responseText);		
	   $('#cboPropertyType').html('');
  	   $('#cboPropertyType').append( new Option('Property Type',''));      			
	   $('#cboPropertyType').val('Property Type');
	  }, 
	  "html"
	);

I have a response text coming after changing city and this will be populated in second drop down
cboLocation. Now the third drop down should be repopulated based on property type at city by taking common location selected in to consideration. for that you should reset property type apart from resetting cboLocation.

To do so

        $('#cboPropertyType').html('');
  	$('#cboPropertyType').append( new Option('Property Type',''));      			
	$('#cboPropertyType').val('Property Type');
  1. $(‘#cboPropertyType’).html(”) – To empty the Content of Drop down
  2. $(‘#cboPropertyType’).append( new Option(‘Property Type’,”)) – It should Contain only Property Type in Option so i am Appending that
  3. $(‘#cboPropertyType’).val(‘Property Type’) – It should point to only one option that exixts
function seo($input)
{
    //remove single quote and dash
    $input = str_replace(array("'", "-"), "", $input); 

    //convert to lowercase
    $input = mb_convert_case($input, MB_CASE_LOWER, "UTF-8"); 

    //replace everything non an with dashes
    $input = preg_replace("#[^a-zA-Z0-9]+#", "-", $input); 

    //replace multiple dashes with one
    $input = preg_replace("#(-){2,}#", "$1", $input);

    //trim dashes from beginning and end of string if any
    $input = trim($input, "-"); 
    
    //voila
    return $input; 
}

OP:
echo seo(“Tom’s Fish & Chips”); //toms-fish-chips
echo seo(“1-2-3 Pizza”); //123-pizza

The below function takes array element which needs to be removed as parameter as below

ary.remove(‘One’);
var ary = [‘One’, ‘Two’, ‘Three’];
Array.prototype.remove = function() {
    var what, a = arguments, L = a.length, ax;
    while (L && this.length) {
        what = a[--L];
        while ((ax = this.indexOf(what)) !== -1) {
            this.splice(ax, 1);
        }
    }
    return this;
};

The above method works perfectly works for java script array with strings in it.

For the below variable

var csvEmpIds = ‘1,2,3,4,5’;
arrEmpIds = csvEmpIds.split(‘,’);
ary.remove(2);

The above will not work as you should pass 2 as a string and split function creates
a array by splitting from one variable and putting as a strings in array.

so csvEmpIds.split(‘,’) will create array like below

arrEmpIds = ['1','2','3','4','5'];

In this case to remove element from array which you got by splitting come delimited value you should
do as below.

ary.remove('2');

To Remove array which is declared globally use the below function

var ary = ['three', 'seven', 'eleven'];
removeA(ary, 'seven');
function removeA(arr)
{
  var what, a = arguments, L = a.length, ax;
  
  while (L > 1 && arr.length) 
  {
    what = a[--L];
    while ((ax= arr.indexOf(what)) !== -1) 
    {
      arr.splice(ax, 1);
    }
   }

   return arr;
}

HTTP Cookies are not a feature of PHP, nor a feature of Javascript : those are just programming languages that allow a developper to manipulate them.

The biggest difference between JS and PHP is that :

Javascript runs on the client side
PHP runs on the server side

But cookies are still the same : they are defined as a standard — see RFC 2965.

Still, note that modern browsers implement cookies that are not accessible from Javascript (see the httponly option of setcookie) — which means that, depending on the browser, and the way a cookie was set, it might not be accessible from Javascript.

This is a security measure — and is not a difference between “js cookies” and “php cookies” : it’s just a property of some cookies.

Create session cookie

  $.cookie('CookieName', 'Value');

Cookie that Expires in 7 days

 $.cookie('CookieName', 'Value', { expires: 7 });

Create cookie valid across entire site:

  $.cookie('CookieName', 'Value', { expires: 7, path: '/' });

Read value cookie:

 $.cookie('the_cookie'); // => "the_value"
 $.cookie('not_existing'); // => null

Delete cookie:

 // Returns true when cookie was found, false when no cookie was found...
 $.removeCookie('the_cookie');

 // Same path as when the cookie was written...
 $.removeCookie('the_cookie', { path: '/' });
CREATE TABLE `fruits` (
      `fruit_id` int(11) default NULL,
      `fruit_name` varchar(255) collate latin1_general_ci default NULL
    );

INSERT INTO fruits(fruit_id, fruit_name) 
          VALUES (101, 'Mango'),
                 (102, 'Apple'),
                 (103, 'Orange'),
                 (104, 'Pineapple'),
                 (105, 'Lemon'),
                 (106, 'Custard');
SELECT row
  FROM (SELECT fruit_id, CAST(fruit_id AS CHAR(255)) row
          FROM fruits
        UNION
        SELECT fruit_id, CAST(fruit_name AS CHAR(255)) row
          FROM fruits) s
 WHERE fruit_id = 101;

Output

 101
 Mango 
//function for converting string into indian currency format
    function intToFormat(nStr)
    {
     nStr += '';
     x = nStr.split('.');
     x1 = x[0];
     x2 = x.length > 1 ? '.' + x[1] : '';
     var rgx = /(d+)(d{3})/;
     var z = 0;
     var len = String(x1).length;
     var num = parseInt((len/2)-1);
 
      while (rgx.test(x1))
      {
        if(z > 0)
        {
          x1 = x1.replace(rgx, '$1' + ',' + '$2');
        }
        else
        {
          x1 = x1.replace(rgx, '$1' + ',' + '$2');
          rgx = /(d+)(d{2})/;
        }
        z++;
        num--;
        if(num == 0)
        {
          break;
        }
      }
     return x1 + x2;
    }