I found this wonderful site that ports commonly used, built in PHP functions into JavaScript.
Basically, just include the library and you should have all your common PHP functions like strlen, count, in_array, array_keys etc in Javascript. How cool is that!
I find the string manipulation functions most useful. The best part is you can choose to download only the functions that you need, individually, instead of the whole library.
Here is the list of functions currently ported to Javascript: http://phpjs.org/functions/index
Here is the link to the library homepage: http://phpjs.org/
Remember is this just a collection of functions built in PHP and not a framework like Jquery
