move formatting from JS to PHP