Php For Each Item In Array Javascript Methods And Functions