Javascript Replace Part Of Array Methods In Php