Php If Array Has Javascript Functions Within Functions