src/Net/API/DDNSS.php
static public function update( $key, $hosts ){
		if( is_array( $hosts ) )
			$hosts	= implode( ",", $hosts );
		$url	= sprintf( self::$urlUpdate, $key, $hosts );
		try{
			$reader		= new Net_Reader( $url );
			$reader->setUserAgent( "cURL" );
			$response	= strip_tags( $reader->read() );
			if( !preg_match( "/Updated [0-9]+ /", $response ) )
				return 0;
			$number	= preg_replace( "/^.+Updated ([0-9]+) host.+$/s", "\\1", $response );
			return (int) $number;
		}
		catch( Exception $e ){
			die( $e->getMessage() );
		}
	}
static public function update( $key, $hosts ){
		if( is_array( $hosts ) )
			$hosts	= implode( ",", $hosts );
		$url	= sprintf( self::$urlUpdate, $key, $hosts );
		try{
			$reader		= new Net_Reader( $url );
			$reader->setUserAgent( "cURL" );
			$response	= strip_tags( $reader->read() );
			if( !preg_match( "/Updated [0-9]+ /", $response ) )
				return 0;
			$number	= preg_replace( "/^.+Updated ([0-9]+) host.+$/s", "\\1", $response );
			return (int) $number;
		}
		catch( Exception $e ){
			die( $e->getMessage() );
		}
	}
static public function update ( $ key , $ hosts ) { if ( is_array ( $ hosts ) ) $ hosts = implode ( "," , $ hosts ) ; $ url = sprintf ( self :: $ urlUpdate , $ key , $ hosts ) ; try { $ reader = new Net_Reader ( $ url ) ; $ reader -> setUserAgent ( "cURL" ) ; $ response = strip_tags ( $ reader -> read ( ) ) ; if ( ! preg_match ( "/Updated [0-9]+ /" , $ response ) ) return 0 ; $ number = preg_replace ( "/^.+Updated ([0-9]+) host.+$/s" , "\\1" , $ response ) ; return ( int ) $ number ; } catch ( Exception $ e ) { die ( $ e -> getMessage ( ) ) ; } }
Updated host or hosts.
@static
@param		string		$key		Auth key from DDNSS
@param		string|array	$hosts		Host or list of hosts
@return		integer		Number of updated hosts
@todo		parse response header DDNSS-Response
@todo		and handle update errors
Updated host or hosts .