static function ReplaceFirst($s,$r,$str)
	{
		$l = strlen($str);
		$a = strpos($str,$s);
		$b = $a + strlen($s);
		$temp = substr($str,0,$a) . $r . substr($str,$b,($l-$b));
		return $temp;
	}
static function ReplaceFirst($s,$r,$str)
	{
		$l = strlen($str);
		$a = strpos($str,$s);
		$b = $a + strlen($s);
		$temp = substr($str,0,$a) . $r . substr($str,$b,($l-$b));
		return $temp;
	}
static function ReplaceFirst ( $ s , $ r , $ str ) { $ l = strlen ( $ str ) ; $ a = strpos ( $ str , $ s ) ; $ b = $ a + strlen ( $ s ) ; $ temp = substr ( $ str , 0 , $ a ) . $ r . substr ( $ str , $ b , ( $ l - $ b ) ) ; return $ temp ; }
replace the first occurrance only within a string
@param string needle
@param string replacement
@param string haystack
replace the first occurrance only within a string