Php If Key In Array Javascript Length