I just managed to complete what you are asking.
I have a script which passes many variables through $_GET, one of them in format "n,n1,n2,n3,nn,". This is just a variable, but I needed it in an array to properly display it all.
I started with:
$results = $_GET['results'];
I then put it into an array:
$explodeResults = explode (",", $results);
If I know exactly what piece I want to echo, I can say:
echo $explodeResults[2];
Which actually echos the third item in the array. If I don't know what I want, but want to see everything, I can say:
for ($i = 0; $i < $n; $i++)
{
$arrayNum = $i + 1;
echo ("Item $arrayNum of the array contains value $explodeResults[$i]");
}
And from there, I can see the entire array and what values it contains.
Note, in the above example, I increase the count number by 1, so it's easier to know where it is in the array. People tend to count starting from 1, whereas arrays start counting from 0.
I hope this helps 🙂