php loop through array
22:45 10 Sep 2014

I am trying to get certain values from an array but got stuck. Here is how the array looks:

array(2) {
  [0]=>
  array(2) {
    ["attribute_code"]=>
    string(12) "manufacturer"
    ["attribute_value"]=>
    string(3) "205"
  }
  [1]=>
  array(2) {
    ["attribute_code"]=>
    string(10) "silhouette"
    ["attribute_value"]=>
    array(1) {
      [0]=>
      string(3) "169"
    }
  }
}

So from it I would like to have attribute_values, and insert it into a new array, so in this example I need 205 and 169. But the problem is that attribute_value can be array or string. This is what I have right now but it only gets me the first value - 205.

foreach ($array as $k => $v) {
  $vMine[] = $v['attribute_value'];
}

What I am missing here?

Thank you!

php arrays