title: PHP associative arrays within if-else
body: <p>I am new to PHP, could someone please let me know as to what I am doing wrong here:-</p>
  
  <pre><code>&lt;?php
  $arr = array(
  'firstName' =&gt; 'Manav',
  'lastName' =&gt; 'Saxena',
  'users' =&gt; array(
      array(    'Name' =&gt; 'John',
      'age' =&gt; 24),
      array( 'Name' =&gt; 'Unknown',
      'age' =&gt; 22)
  ));
  
  if($arr['firstName'] == 'Manav'){
      echo "Hello $arr['firstName']";
  }
  
  foreach($arr['users'] as $user){
      echo "$user['Name'] is $user['age'] years old!";
  }
  
  ?&gt;
  </code></pre>