Php Check If Array Is Not Empty Javascript Function How To Use