Javascript Dynamically Create Array Php Functions