title: How to encode only 2 chars in path?
body: <p>I have a $delete path and a $user_id each include '#' and '@' respectively within the string. How can I replace each with the encoded value %23 and $40. </p>
  
  <p>I tired using str_replace but did not have any luck:
  <code>str_replace($string, array('@', '#'), array('%40', '%23'));</code></p>
  
  <p>My full Delete path looks like this:</p>
  
  <pre><code>$delete = "http://admin:12345@192.168.245.133/@api/deki/DELETE:users/$user_id/properties/%s";
  </code></pre>
  
  <p>I feel like the $user_id should be pretty simple. For the properties it has to loop through to get all the available properties. You can see the loop below:</p>
  
  <pre><code>foreach($xml-&gt;property as $property) {
        $name = $property['name']; // the name is stored in the attribute
        curl_fetch(sprintf($delete, $name),'admin','12345');
      }
  </code></pre>
  
  <p>Each property contains a '#', so is there a way that each iteration which modify '#' to be the appropriate value?</p>
  
  <p>Thanks in advance.</p>