title: Switch off the g (global) modifier in preg_replace
body: <p>The <code>g (global)</code> modifier is <code>on</code> by default in <code>preg_replace</code> PHP, how can it be switched off ?</p>
  
  <p>If I do a <code>preg_replace(/n/,'',$string);</code> it will replace all occurrences of <code>n</code> but I want to replace only the first occurrence of <code>n</code>. How should I do it?   </p>