-2

I'm trying to set the post_id as a variable using the following but I'm getting an Undefined index error.

$propertyID['post_id']

This is my var_dump()

array(1) {
  [0]=>
  array(2) {
    ["post_id"]=>
    string(4) "4323"
    ["meta_key"]=>
    string(9) "unique_id"
  }
}
James George Dunn
  • 523
  • 1
  • 6
  • 16

2 Answers2

1

You have to use $propertyID[0]['post_id']

mario.van.zadel
  • 2,919
  • 14
  • 23
0

All value in index 0 of array :-

$propertyID[0]['post_id'] //result :- 4323
$propertyID[0]['meta_key'] //result :- unique_id
Abhishek Sharma
  • 6,689
  • 1
  • 14
  • 20