How Can I Trim This Array? I Want to echo First Object of My Array,That is id, I Mean 3 Row of id
<?php
$con=mysqli_connect("localhost","root","","arrayy");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT `survey_answers` FROM `user_survey_start`";
if ($result=mysqli_query($con,$sql)){
while ($row = mysqli_fetch_row($result)){
$json = $row[0];
$jason_array = json_decode($json,true);
foreach ($jason_array as $data){
$id[] = $data['id'];
//$answer[] = $data['answer'];
// $type[] = $data['type'];
// here code to insert/update values to db column
}
echo implode(',',$id)."</br>";
// echo implode(',',$answer);
// echo implode (',',$type);
}
}
mysqli_close($con);
?>

Array ( [0] => 26 [1] => 30 [2] => 31 [3] => 32 [4] => 33 ) Array ( [0] => 26 [1] => 30 [2] => 31 [3] => 32 [4] => 33 [5] => 40 [6] => 30 [7] => 31 [8] => 32 [9] => 33 ) Array ( [0] => 26 [1] => 30 [2] => 31 [3] => 32 [4] => 33 [5] => 40 [6] => 30 [7] => 31 [8] => 32 [9] => 33 [10] => 100 [11] => 200 [12] => 300 [13] => 400 )