Daemon Developer
Daemon Developer

Reputation: 71

Array in Cake PHP

Currently I have this Array:

Array
(
  [0]=>Array
             (
                 [name]=> Name 1
             )
  [1]=>Array
             (
                 [name]=> Name 2
             )
)

How can I manipulate this array to display like this

Array(
      [0] =>Name 1
      [1] =>Name 2
      )

Upvotes: 1

Views: 119

Answers (1)

Predominant
Predominant

Reputation: 1460

Use the Set class:

Set::extract('/name', $data);

Upvotes: 2

Related Questions