Abel1416's post in How would I give each appended li elements a unique I'd? was marked as the answer
Thanks to you all!! I would have saved myself from posting this question if I took a second to check my responses from the backend.
$attempted = implode(" ,",$arr); Which made the response had a space [1 ,2 ,3 ,4];
thanks once again