Ваши данные - это массив объектов.Таким образом, вы должны получить доступ к данным, используя обозначение объекта.
Например: $object->property;
<code>$array = Array (
'0' => (Object)array( 'id_destino' => 483596, 'id_tag' => 0, 'endereco' => 'Belo Horizonte, Minas Gerais', 'sort' => 0),
'1' => (Object)array( 'id_destino' => 483596, 'id_tag' => 1, 'endereco' => 'Maricá, Rio de Janeiro', 'sort' => 1),
'2' => (Object)array( 'id_destino' => 483596, 'id_tag' => 2, 'endereco' => 'Monte Mor, São Paulo', 'sort' => 2)
);
//Here we get the first element and access the object's property.
$first_record = $array[0]->endereco;
//Here we get the last element by counting the number of elements and then accessing the last element's object properties.
$last_record = $array[count($array) - 1]->endereco;
//Here we loop through your array and using the loop's indexes only iterate across
//the middle of the array. On each iteration we push the object's property into a new array.
for($i = 1; $i < count($array) - 1; $i++){
$new_array[] = $array[$i]->endereco;
}
echo $first_record . '<br>';
echo $last_record . '<br>';
echo '<pre>';
print_r($new_array);
echo '
';
Будет выведено:
Belo Horizonte, Minas Gerais
Monte Mor, São Paulo
Array
(
[0] => Maricá, Rio de Janeiro
)