These functions are equivalent to PHP’s trim() and nl2br() function written in Javascript and are most useful in working with formatting text inputs and textareas values.Trim() strips whitespaces from the beginning and end of a string and nl2br() inserts HTML line breaks (<br />) and replaces newlines or carriage returns(Enter key) in a string.
The function:
function [...]
PHP.JS is an open source project that port PHP functions to JavaScript. By including the PHP.JS library in your own projects, you can use your favorite PHP functions client-side.There is no server component required.Using PHP.JS may speed up development for PHP developers who are increasingly confronted with client-side technology.
It is dual licensed under the [...]