I am exploding an array appending it and then I am imploding the array back. Everything works fine but I got a small doubt. Please take the example below.
$x = "123,456,789"
explode (' ', $x);
$x[] = "987";
implode (',', $x);
The output looks like the following :
,123,456,789,987
The problem is that the comma appears before the values. I want them to appear after just like the following
123,456,789,987,