title: PHP - String Replace SyntaxError: illegal character
body: <p><strong>Output for $status</strong></p>
  
  <pre><code>Array
  (
      [1] =&gt; 1
      [2] =&gt; 0
      [3] =&gt; 0
      [4] =&gt; 4
      [5] =&gt; 4
  )
  
  $color_code_string = implode(",",$status);
  </code></pre>
  
  <p><strong>Ouput</strong></p>
  
  <pre><code>1,0,0,4,4
  
  $color_code_string = str_replace("0","'#F00'",$color_code_string); 
  $color_code_string = str_replace("1","'#00bcd4'",$color_code_string);
  $color_code_string = str_replace("2","'#4caf50'",$color_code_string);
  $color_code_string = str_replace("3","'#bdbdbd'",$color_code_string);
  $color_code_string = str_replace("4","'#ff9900'",$color_code_string);
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>SyntaxError: illegal character
  colors: ['#00bcd'#ff9900'','#F00','#F00','#ff9900','#ff9900']
  
  //prints '#00bcd'#ff9900'','#F00','#F00','#ff9900','#ff9900'
  </code></pre>
  
  <p>How do I achieve expected output as below</p>
  
  <pre><code>'#00bcd','#ff9900','#F00','#F00','#ff9900','#ff9900'
  </code></pre>