Convert Php Variable To Javascript Substring From Right