Convert Php Variable To Javascript Array Methods Map