title: preg_replace function to append a string to all the hyperlinks of a page
body: <p>i want to append my own value to all hyperlinks in a page... e.g if there are links:</p>
  
  <pre><code>&lt;a href="abc.htm?val=1"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  &lt;a href="abc.htm?val=2"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  &lt;a href="abc.htm?val=3"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  &lt;a href="abc.htm?val=4"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  </code></pre>
  
  <p>I want to add next var like "type=int" to all hyperlinks </p>
  
  <p>output should be:</p>
  
  <pre><code>&lt;a href="abc.htm?val=1&amp;type=int"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  &lt;a href="abc.htm?val=2&amp;type=int"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  &lt;a href="abc.htm?val=3&amp;type=int"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  &lt;a href="abc.htm?val=4&amp;type=int"&gt;abc 1&lt;/a&gt; &lt;br/&gt;
  </code></pre>
  
  <p>I hope it can be done quite easily with preg_replace function</p>