Question: I have an array that I'm creating inside my PHP script, the var\_dump function gives me this value :`var_dump($arrayOfValues);`

```
array(3) { 
    [0]=> array(2) { 
        [0]=> string(12) "BusinessName" 
        [1]=> string(13) "ITCompany" 
    } 
    [1]=> array(2) {  
        [0]=> string(7) "Address"  
        [1]=> string(58) "29 xxxxxx,Canada"  
    }  
    [2]=> array(2) {  
        [0]=> string(20) "PrimaryBusinessPhone"  
        [1]=> string(14) "(444) 111-1111"  
    }  
    [3]=> array(2) {  
        [0]=> string(13) "BusinessEmail"  
        [1]=> string(24) "xx@example.com" 
    }
} 

```

I would like to access to the value of the "BusinessName" using key and not index so if I put : `echo $arrayOfValue[0][1];` it gives me the BusinessName that is ITCompany but if I put 
: `echo $arrayOfValue['BusinessName'][1];` it gives nothing so how can I fix that please?

The array is initialized `$arrayOfValue = array();` and then populated dynamically inside a for loop like that 

```
$arrayOfValue[] = array($Label, $Value);

```

Answer: 
your array has this kind of data
================================

```
$arrayOfPostsValue[] = array("BusinessName","ITCompany");
$arrayOfPostsValue[] = array("Address","29 xxxxxx,Canada");
$arrayOfPostsValue[] = array("PrimaryBusinessPhone","(444) 111-1111");
$arrayOfPostsValue[] = array("BusinessEmail","xx@example.com");

```

there is no array key in data So, you have to recreate your desire array
========================================================================

```
$newArrayOfPostsValue = array();

foreach ( $arrayOfPostsValue as $value ){
    $newArrayOfPostsValue[$value[0]] = $value[1];
}

print_r($newArrayOfPostsValue);

```

and here is output
==================

```
Array
(
    [BusinessName] => ITCompany
    [Address] => 29 xxxxxx,Canada
    [PrimaryBusinessPhone] => (444) 111-1111
    [BusinessEmail] => xx@example.com
)

```
As mentioned in the comment, change the structure of the array, it will be much easier to handle

```
   $my_array = array(
      array('Business Name' => 'It Company'), 
      array('Address' => 'My address')
   ); 

```

Looking at the content of your array, I will restructure it as 

```
$my_improved_array = array(
  'BusinessName' => 'It Company', 
  'Address' => 'My Address',
); 

```

This is how you can access, 

```
echo $my_array[0]['BusinessName'] //prints 'It Company'
echo $my_array[1]['Address'] //prints 'My Address'

echo $my_improved_array['BusinessName'] // prints 'It Company'

```