Php Split String Function Javascript