Php Array Append Array Javascript Length Function