PHP functions in Javascript

I like javascript, but I spend too much time wrting some functions just to use it more than once.  In most cases I uses prototype.js to create a shorter code but still being long. Recently I was porting some basic php functions to javascript like  isset(), array_keys(), in_array(), explode() and many more. I was very frustrated, because I had to write a mini-framework just to create a simple application. Within a few hours had hundreds of lines of code.

Then on Internet I found this: PHP.js, an open source project in which they try to port PHP functions to JavaScript. By including the PHP.JS library in your own projects, you can use your favorite PHP functions on the client-side. This convenience may speed up development for PHP developers who are increasingly confronted with client-side technology.

The History of PHP.JS

A developer called Kevin van Zonneveld was once working on a project with a lot of client(JS) / server(PHP) interaction, and he found himself coding PHP functions (like base64_decode & urldecode) in JavaScript to smoothen communication between the two languages. He stored the stored the functions in a file called php.js which was included in the project. Kevin decided to share the little library online, which triggered the enthusiasm of a lot of PHP developers longing for PHP functionality in JavaScript. The project was open sourced in 2008, and many people contributed their own functions in the comments sections of Kevin's blog. It was decided that the library deserved a bigger home, and a face of its own, and so the PHP.JS core team developed the phpjs.org website.

List of functions

To see the list of functions click here PHP.JS: Functions Overview.

More Information:  http://phpjs.org/

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]