Converts PHP to JavaScript