title: @ value of POST variable in PHP CURL
body: <p>I'm creating a function to untilize NameCheap's API for registering domain names.  The registration process worked out smoothly, now I'm looking to set the proper DNS Hosts.</p>
  
  <p>When I create a pure POST request with something like POSTMAN this works fine and returns the expected XML response.  However when I try to pass the data through PHP's CURL functions it breaks.  I've narrowed the problem the the '@' symbol that needs to be passed to the DNS Host. If i put anything else there the request goes through.  I've tried to url_encode the symbol but the API does not accept that.</p>
  
  <p>Any suggestions?</p>
  
  <pre><code>public function setDNSHost($name, $server){
      list($domain,$tld) = explode('.',$name,2);
      $request = $this-&gt;request_URL;
  
      $curl = curl_init();
  
      $args['ApiUser'] = $this-&gt;API_User;
      $args['ApiKey'] = $this-&gt;API_Key;
      $args['UserName'] = $this-&gt;API_User;
      $args['Command'] = 'namecheap.domains.dns.setHosts';
  
      $args['ClientIP'] = $this-&gt;Client_IP;
  
  
      $args['SLD'] = $domain;
      $args['TLD'] = $tld;
  
      $args['HostName1'] = utf8_encode('@');
      $args['RecordType1'] = 'A';
      $args['Address1'] = $server;
  
      $args['HostName2'] = 'www';
      $args['RecordType2'] = 'CNAME';
      $args['Address2'] = $name;
  
      $args['HostName3'] = '*';
      $args['RecordType3'] = 'CNAME';
      $args['Address3'] = $name;
  
      curl_setopt_array($curl, array(
          CURLOPT_URL =&gt; $request,
          CURLOPT_USERAGENT =&gt; 'API',
          // CURLOPT_FAILONERROR =&gt; 1,
           CURLOPT_FOLLOWLOCATION =&gt; 1,
           CURLOPT_RETURNTRANSFER =&gt; 1,
           CURLOPT_CUSTOMREQUEST =&gt; "POST",
           CURLOPT_POSTFIELDS =&gt; $args,
           CURLOPT_TIMEOUT =&gt; 15
      ));
  
      $response = curl_exec($curl);
      curl_close($curl);
  
      // $oXML = new SimpleXMLElement($response);
  
      return $response;
  
  }
  </code></pre>