title: Escaping & (ampersand) in SOQL
body: <p>I have this piece of code to search for data on Salesforce:</p>
  
  <p>Code:  </p>
  
  <pre><code>$campaign_name = 'A &amp; B Campaign';  
  $search = 'FIND {'.$campaign_name.'} IN NAME FIELDS RETURNING CAMPAIGN(ID)';
  $searchResult = $mySforceConnection-&gt;search($search);
  var_dump('$searchResult: ' . print_r($searchResult, true));
  </code></pre>
  
  <p>Error:  </p>
  
  <pre><code>mismatched character '&amp;' expecting '}'
  </code></pre>
  
  <p>I tried to use <code>preg_replace</code>, <code>htmlentities</code>, I keep getting the same error, what can I do to be able to search for strings containing <code>&amp;</code>?</p>
  
  <p>Thanks.</p>