title: Formatting a php variable into a php string with quotes
body: <p>I've tried multiple ways to format this http string, like escaping the <code>"</code> that are present in <code>"user"</code> and the user's name, but the API I'm connecting to will not work with anything but <code>%22</code>, so:</p>
  
  <pre><code>https://url.com/search/search?p=[{"user":"abc123"}]
  </code></pre>
  
  <p>has to be formatted like this:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_URL, 'https://url.com/search/search?p=[{%22user%22:%22abc123%22}]');
  </code></pre>
  
  <p>into this:</p>
  
  <p>I need to replace <code>%22abc123%22</code> with the actual user from a PHP variable, so the code looks like this: </p>
  
  <p><code>[{%22user%22:%22 $phpVariable %22}]');</code> </p>
  
  <p>and is still enclosed in the <code>%22</code>, but I cannot figure out how to get the variable into the string without causing the string to give me an error.  How do I do this (very simple) task?</p>