src/snapchat.php
public function register($username, $password, $email, $birthday) {
		$timestamp = parent::timestamp();
		$result = parent::post(
			'/register',
			array(
				'birthday' => $birthday,
				'password' => $password,
				'email' => $email,
				'timestamp' => $timestamp,
			),
			array(
				parent::STATIC_TOKEN,
				$timestamp,
			)
		);

		if (!isset($result->token)) {
			return FALSE;
		}

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/registeru',
			array(
				'email' => $email,
				'username' => $username,
				'timestamp' => $timestamp,
			),
			array(
				parent::STATIC_TOKEN,
				$timestamp,
			)
		);

		// If registration is successful, set the username and auth_token.
		if (isset($result->logged) && $result->logged) {
			$this->auth_token = $result->auth_token;
			$this->username = $result->username;

			$this->cache = new SnapchatCache();
			$this->cache->set('updates', $result);

			return $result;
		}
		else {
			return FALSE;
		}
	}
public function register($username, $password, $email, $birthday) {
		$timestamp = parent::timestamp();
		$result = parent::post(
			'/register',
			array(
				'birthday' => $birthday,
				'password' => $password,
				'email' => $email,
				'timestamp' => $timestamp,
			),
			array(
				parent::STATIC_TOKEN,
				$timestamp,
			)
		);

		if (!isset($result->token)) {
			return FALSE;
		}

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/registeru',
			array(
				'email' => $email,
				'username' => $username,
				'timestamp' => $timestamp,
			),
			array(
				parent::STATIC_TOKEN,
				$timestamp,
			)
		);

		// If registration is successful, set the username and auth_token.
		if (isset($result->logged) && $result->logged) {
			$this->auth_token = $result->auth_token;
			$this->username = $result->username;

			$this->cache = new SnapchatCache();
			$this->cache->set('updates', $result);

			return $result;
		}
		else {
			return FALSE;
		}
	}
public function register ( $ username , $ password , $ email , $ birthday ) { $ timestamp = parent :: timestamp ( ) ; $ result = parent :: post ( '/register' , array ( 'birthday' => $ birthday , 'password' => $ password , 'email' => $ email , 'timestamp' => $ timestamp , ) , array ( parent :: STATIC_TOKEN , $ timestamp , ) ) ; if ( ! isset ( $ result -> token ) ) { return FALSE ; } $ timestamp = parent :: timestamp ( ) ; $ result = parent :: post ( '/registeru' , array ( 'email' => $ email , 'username' => $ username , 'timestamp' => $ timestamp , ) , array ( parent :: STATIC_TOKEN , $ timestamp , ) ) ; // If registration is successful, set the username and auth_token. if ( isset ( $ result -> logged ) && $ result -> logged ) { $ this -> auth_token = $ result -> auth_token ; $ this -> username = $ result -> username ; $ this -> cache = new SnapchatCache ( ) ; $ this -> cache -> set ( 'updates' , $ result ) ; return $ result ; } else { return FALSE ; } }
Creates a user account.

@todo
Add better validation.

@param string $username
The desired username.
@param string $password
The password to associate with the account.
@param string $email
The email address to associate with the account.
@param $birthday string
The user's birthday (yyyy-mm-dd).

@return mixed
The data returned by the service or FALSE if registration failed.
Generally, returns the same result as calling self::getUpdates().
Creates a user account .