Javascript: How to Find Position of a Character in a String

Tuesday, October 18th, 2011

Sometime you may need to find position of a character in a string, charAt() string method comes in for the purpose. For instance, when you execute the following code; var mystr = 'I am a test String.'; document.write(mystr.charAt(3)); // Result will be 'm'

Javascript: How to Convert String Case (Upper & Lower)

Tuesday, October 18th, 2011

If you need to convert string case in Javascript, you may use the following 2 methods as needed. toLowerCase(); toUpperCase();

How to Sort Arrays by Values & Keys in PHP

Monday, August 22nd, 2011

If you want to sort arrays in PHP in ascending / descending order by array values, you may use the following code snippets. First lets create an array; $array = array("Red", "Green", "Blue", "Yellow", "White", "Black"); Now lets use PHP's built-in function sort() that will sort the array by values in ascending order.