This PHP programme returns the greatest common denominator from the input.

/*******************************************************
*     MYCPLUS Sample Code - https://www.mycplus.com     *
*                                                     *
*   This code is made available as a service to our   *
*      visitors and is provided strictly for the      *
*               purpose of illustration.              *
*                                                     *
* Please direct all inquiries to saqib at mycplus.com *
*******************************************************/



func_get_args


 1; $i--)
		{
			//assume we will find a gcd
			$isCommon = TRUE;

			//try each number in the supplied arguments
			foreach(func_get_args() as $arg)
			{
				//if $arg divided by $i produces a
				//remainder, then we don't have a gcd
				if(($arg % $i) != 0)
				{
					$isCommon = FALSE;
				}
			}

			//if we made it through the previous code
			//and $isCommon is still TRUE, then we found
			//our gcd
			if($isCommon)
			{
				break;
			}
		}

		return($i);
	}

	//prints 5
	print(gcd(10, 20, -35) . "
\n"); ?>