Convert Php Variable To Javascript Substring