Javascript Array Methods Foreach Jquery Array Functions In Php