Use PHP functions in JavaScript