preg_replace n times a matching string?
<p>this should be very simple question, but i cant get it working for some reason, my framework is PHALCON</p>

<pre><code>$string='GuGuSy';
</code></pre>

<p>i want this to be replaced as </p>

<pre><code>$output = 'AAB';
</code></pre>

<p>so I coded it as: </p>

<pre><code> public function graha($planet)
    {
            if(strpos($planet,'Sy')!==false){
                $planet = preg_replace("/Sy/",'B',$planet);
            }
            if(strpos($planet,'Gu')!==false){
                $planet = preg_replace("/Gu/",'A',$planet);
                    //str_replace("Gu",'A',$planet);
            }
      return $planet;
  }
</code></pre>

<p>but output I get is not correct, why?</p>

<p><strong>My output is for the string is "A" only why ?</strong></p>