title: Hardcode JSON Array in PHP
body: <p>I have two variables from two different SQL queries that I want to put in to one JSON Array (i.e <code>$hometown</code> and <code>$topcat</code>).  I am trying to hardcode it but not sure how it's suppose to look.</p>
  
  <pre><code>   print(json_encode('{"hometown":"' . $hometown .'", "category":"'. $topcat .'"}'));
  </code></pre>
  
  <p>My output is this:</p>
  
  <pre><code>{\"hometown\":\"Seattle, WA\", \"category\":\"Movies\"}"
  </code></pre>
  
  <p>Not sure where the slashes are coming from (I suppose I can to do stripslashes?) and it seems I need to add '[' and ']' as well?  What is the proper formatting for this?</p>