private function replaceOnce($search, $replace, $subject)
    {
        $pos = strpos($subject, $search);
        if ($pos !== false) {
            $subject = substr_replace($subject, $replace, $pos, strlen($search));
        }

        return $subject;
    }
private function replaceOnce($search, $replace, $subject)
    {
        $pos = strpos($subject, $search);
        if ($pos !== false) {
            $subject = substr_replace($subject, $replace, $pos, strlen($search));
        }

        return $subject;
    }
private function replaceOnce ( $ search , $ replace , $ subject ) { $ pos = strpos ( $ subject , $ search ) ; if ( $ pos !== false ) { $ subject = substr_replace ( $ subject , $ replace , $ pos , strlen ( $ search ) ) ; } return $ subject ; }
Replace the first occurrence of a string

@param  string $search
@param  string $replace
@param  string $subject
@return mixed
Replace the first occurrence of a string