keepassphp/keepassphp.php
public static function extractHalfPassword($pwd)
	{
		$l = strlen($pwd);
		if($l < 4)
			return $pwd;
		else
			return substr($pwd, 0, intval(floor($l/2)));
	}
public static function extractHalfPassword($pwd)
	{
		$l = strlen($pwd);
		if($l < 4)
			return $pwd;
		else
			return substr($pwd, 0, intval(floor($l/2)));
	}
public static function extractHalfPassword ( $ pwd ) { $ l = strlen ( $ pwd ) ; if ( $ l < 4 ) return $ pwd ; else return substr ( $ pwd , 0 , intval ( floor ( $ l / 2 ) ) ) ; }
Extracts a subpart of the input string if it long enough.
@param $pwd A password, that should be longer than 4 characters.
@return A subpart of the input string.
Extracts a subpart of the input string if it long enough .