PHP and Javascript Combine with PHP.JS
I wanted to write a quick post about a library one of my co-workers stumbled upon this week. It is called php.js and is a compilation of php functions ported to javascript. That sounds pretty convenient!
There are two flavors of php.js – one contains just the compiled functions, and the other a namespaced version, capable of being extended to a particular customization. There is also the option to customize your download of php.js. That’s right, you can select the functions you want and download only those functions. This is pretty helpful considering the default php.js download weighs in around 100kb minified.
From the phpjs.org homepage:
Using PHP.JS may speed up development for PHP developers who are increasingly confronted with client-side technology.
It is not intended for use as a client-side framework, however integration with a framework like jQuery is possible for binding php functions to events. This is truly a relief for someone, like myself, who is terrified of nuts & bolts javascript.
According to the site the port is 82.1% complete. This is a project I hope to incorporate at some point in my work, and I will continue to watch it closely.


ShareThis