protected function encodeAssociativeArray(array $array, $preserveNames = false)
	{
		ksort($array);
		$src = '{';
		$sep = '';
		foreach ($array as $k => $v)
		{
			$src .= $sep . $this->encodePropertyName("$k", $preserveNames) . ':' . $this->encode($v);
			$sep = ',';
		}
		$src .= '}';

		return $src;
	}
protected function encodeAssociativeArray(array $array, $preserveNames = false)
	{
		ksort($array);
		$src = '{';
		$sep = '';
		foreach ($array as $k => $v)
		{
			$src .= $sep . $this->encodePropertyName("$k", $preserveNames) . ':' . $this->encode($v);
			$sep = ',';
		}
		$src .= '}';

		return $src;
	}
protected function encodeAssociativeArray ( array $ array , $ preserveNames = false ) { ksort ( $ array ) ; $ src = '{' ; $ sep = '' ; foreach ( $ array as $ k => $ v ) { $ src .= $ sep . $ this -> encodePropertyName ( "$k" , $ preserveNames ) . ':' . $ this -> encode ( $ v ) ; $ sep = ',' ; } $ src .= '}' ; return $ src ; }
Encode an associative array to JavaScript

@param  array  $array
@param  bool   $preserveNames
@return string
Encode an associative array to JavaScript