Javascript Check If An Array Is Empty Php