title: Atom Editor: how to highlight singe and double quote strings differently for php
body: <p>I recently installed Clear Linux and their default is Atom editor, so I gave it a try. With the php-autocomplete, I was almost very excited. Until I realized I have become set in my ways and I need to have different highlighting for single vs double quote strings.</p>
  
  <p>In <code>php</code> double quoted strings will still be parsed for <code>$variables</code> and whitespace escape characters like <code>\n</code> and <code>\t</code>; whereas single quoted strings are literal and there is no interpretation between single quotes.</p>
  
  <p>I have developed the habit of always using single quotes for array keys and it disturbed my subconscious to not have the single quoted strings appear different than double quoted strings. I searched quite a bit and couldn't find a solution.</p>
  
  <p><strong>Does anyone know of a way to achieve this highlighting scheme?</strong></p>
  
  <p>The screenshot is from Geany. And even in Geany, getting this setting is not standard. Thankfully, a decade ago, this was normal in their themes so I am able to alter the currently available themes to find and change <code>string_2</code> to a different color than <code>string_2=string_1</code>.</p>
  
  <p>To better help people understand <code>php</code> and how the differences between <code>'</code> and <code>"</code> may have importance, here is one way the strings behave differently in context:</p>
  
  <pre class="lang-php prettyprint-override"><code>    $customer = "Bill Hawthorne";
      $_address = "123 Main St\nGlendale, CA 91202";
  
      $output = "Dear $customer, please confirm the below address is correct:\n\n$_address\n";
  
      // $output renders as:
      // Dear Bill Waltz, please confirm the below address is correct:
      //
      // 123 Main St
      // Glendale, CA 91202
      // 
  
      $output = 'Dear $customer, please confirm the below address is correct:\n\n$_address\n';
      // $output renders as:
      // Dear $customer, please confirm the below address is correct:\n\n$_address\n
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/03KCu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/03KCu.png" alt="screenshot of Geany editor showing different highlight colors for php strings of type single quote and double quote"></a></p>