I am trying to address particular item from array by the index of the item because. I have tried extract method, but I do not have my array defined as follows:
$var_array = array("color" => "blue",
"size" => "medium",
"shape" => "sphere");
Instead I have:
$contents = array();
which is filled in a while loop
.
In c#
I would do for example something like this:
string variable = contents[3];
How can I achieve something like above in PHP?
EDIT: When i do this:
$param1= $contents[0];
echo "$param1";
I get this:
Notice: Array to string conversion in C:\xampp\htdocs\NUSYS\pars.php on line 45 Array
Edit 2
this shows print_r($contents);
Array ( [0] => Array ( [0] => bsd [1] => ghj ) )