Javascript Create New Object From Existing Array Methods In Php