Php Count Items In Array Javascript Append Method In Python