Province/State abbreviations (US/Canada)

January 9th, 2012, posted in Uncategorized

Just in case someone’s looking for this.

function getStateStrByAbbr( $abbr ) {
switch($abbr):
// Canada Province
case 'AB': return 'Alberta'; break;
case 'BC': return 'British Columbia'; break;
case 'MB': return 'Manitoba'; break;
case 'NB': return 'New Brunswick'; break;
case 'NL': return 'Newfoundland and Labrador'; break;
case 'NT': return 'Northwest Territories'; break;
case 'NS': return 'Nova Scotia'; break;
case 'NU': return 'Nunavut'; break;
case 'ON': return 'Ontario'; break;
case 'PE': return 'Prince Edward Island'; break;
case 'QC': return 'Quebec'; break;
case 'SK': return 'Saskatchewan'; break;
case 'YT': return 'Yukon'; break;
// US state
case 'AL': return 'Alabama'; break;
case 'AK': return 'Alaska'; break;
case 'AZ': return 'Arizona'; break;
case 'AR': return 'Arkansas'; break;
case 'CA': return 'California'; break;
case 'CO': return 'Colorado'; break;
case 'CT': return 'Connecticut'; break;
case 'DE': return 'Delaware'; break;
case 'DC': return 'District of Columbia'; break;
case 'FL': return 'Florida'; break;
case 'GA': return 'Georgia'; break;
case 'HI': return 'Hawaii'; break;
case 'ID': return 'Idaho'; break;
case 'IL': return 'Illinois'; break;
case 'IN': return 'Indiana'; break;
case 'IA': return 'Iowa'; break;
case 'KS': return 'Kansas'; break;
case 'KY': return 'Kentucky'; break;
case 'LA': return 'Louisiana'; break;
case 'ME': return 'Maine'; break;
case 'MD': return 'Maryland'; break;
case 'MA': return 'Massachusetts'; break;
case 'MI': return 'Michigan'; break;
case 'MN': return 'Minnesota'; break;
case 'MS': return 'Mississippi'; break;
case 'MO': return 'Missouri'; break;
case 'MT': return 'Montana'; break;
case 'NE': return 'Nebraska'; break;
case 'NV': return 'Nevada'; break;
case 'NH': return 'New Hampshire'; break;
case 'NJ': return 'New Jersey'; break;
case 'NM': return 'New Mexico'; break;
case 'NY': return 'New York'; break;
case 'NC': return 'North Carolina'; break;
case 'ND': return 'North Dakota'; break;
case 'OH': return 'Ohio'; break;
case 'OK': return 'Oklahoma'; break;
case 'OR': return 'Oregon'; break;
case 'PA': return 'Pennsylvania'; break;
case 'PR': return 'Puerto Rico'; break;
case 'RI': return 'Rhode Island'; break;
case 'SC': return 'South Carolina'; break;
case 'SD': return 'South Dakota'; break;
case 'TN': return 'Tennessee'; break;
case 'TX': return 'Texas'; break;
case 'UT': return 'Utah'; break;
case 'VI': return 'Virgin Islands of United States'; break;
case 'VT': return 'Vermont'; break;
case 'VA': return 'Virginia'; break;
case 'WA': return 'Washington'; break;
case 'WV': return 'West Virginia';break;
case 'WI': return 'Wisconsin'; break;
case 'WY': return 'Wyoming'; break;
endswitch;
}

Special characters display on HTML

December 24th, 2011, posted in Uncategorized

UTF-8 specialchar to ASCII

Here is a simple PHP solution to special char display weirdly on html.

I have encountered this because Ajax somehow cannot pass utf-8 correctly.


function toascii($input){

$output = '';
$i = 0;

while($i< strlen($input)): if(ord($input[$i])>127):
$output .= '&#' . ord($input[$i]) . ';';
else:
$output .= $input[$i];
endif;

$i++;
endwhile;

return $output;
}

Attitude is everything…

September 21st, 2011, posted in Feeling Express

I can only trust people so many times before I found out the lies behind everything.

And yet, I still choose to be naive to trust people one more time.

I rather be the one to be hurt than the one to hurt.

Those expression above may not make any sense and it seems a bit dark…

What I’m trying to say is… “Attitude is everything…”

Appreciate what you have and enjoy it.

Thanks and farewell my lovely EQQY family

August 6th, 2011, posted in Feeling Express

It’s been fantastic with you guys/girls. The e-mail I have sent says all.

Definitely a milestone in my life. (sounds weird but you know what I meant)

Keep in touch. Love you all.

My portfolio site is now under beta launching phase

July 25th, 2011, posted in Contributors, General

Still doing changes here and there.

Thanks to Lan for giving me wonderful advice to revise my website.

If by any chance you happen to see this, please let me know what you think and what should be changed.

You can reach me through contact page.

Thanks

Special thanks to…

July 22nd, 2011, posted in Contributors

Thanks to…

This amazing template designed by cssmayo.com
The cute yellow kitty designed by cme.
Especially thanks to George for providing EQQY Hosting service for this website. Also, special thanks to the trade insurance which has been the best insurance I have ever found.