title: PHP Change the value of an arrays element in this case
body: <p>I'm trying to change the value of the first element in the array, which initially starts out as a blank, and then, depending on the error, will be set to 'Success' or 'False'.</p>
  
  <p>But what is the correct way to do this? What I'm trying, does not seem to work.</p>
  
  <pre><code>$arr['ERR'] = '';
  $arr['ERR'] .= '&lt;i&gt;Error 1&lt;/i&gt;,';
  $arr['ERR'] .= '&lt;i&gt;Error 2&lt;/i&gt;,';
  $arr['ERR'] .= '&lt;i&gt;Error 3&lt;/i&gt;,';
  $arr['ERR'] .= '&lt;i&gt;Error 4&lt;/i&gt;,';
  </code></pre>
  
  <p>$errors = 1;</p>
  
  <pre><code>$arr['ERR'][0] = ($errors == 0 ? 'Success' : 'There were errors with your data!');
  
  print_r($arr);
  </code></pre>
  
  <p>print_r gives me:</p>
  
  <pre><code>Array ( [ERR] =&gt;
  Fi&gt;Error 1
  Error 2
  Error 3
  Error 4
  ) 
  </code></pre>
  
  <p>PS: I need that particular element right at the top.</p>
  
  <p>What I'm hoping to achieve is:</p>
  
  <p><code>Array ( [ERR] =&gt; There were errors with your data,Error 1,Error 2,Error 3,Error 4, )</code></p>