Unity

<?php

/**
 * unity
 *
 * Returns digit summation of any numerical value given for passkey (up to 14 digits in length)
 *
 * @version 1.2
 * @author Contributors at eXorithm
 * @link https://www.exorithm.com/algorithm/view/unity Listing at eXorithm
 * @link https://www.exorithm.com/algorithm/history/unity History at eXorithm
 * @license https://www.exorithm.com/home/show/license
 *
 * @param number $passkey enter any numerical "whole" digits (non-negative)
 * @return mixed
 */
function unity($passkey=75025)
{
	$ubn = array();
	
	while ($passkey > 9) {
		if (strlen($passkey) > 1)
			$passkey = array_sum(str_split($passkey));
		else
			$passkey = $passkey;
	} 
	
	$ubn[] = $passkey;
	
	return end($ubn);
}

?>