src/whatsprot.class.php
public function sendChangeNumber($number, $identity)
    {
        $msgId = $this->createIqId();

        $usernameNode = new ProtocolNode('username', null, null, $number);
        $passwordNode = new ProtocolNode('password', null, null, urldecode($identity));

        $modifyNode = new ProtocolNode('modify', null, [$usernameNode, $passwordNode], null);

        $iqNode = new ProtocolNode('iq',
            [
                'xmlns' => 'urn:xmpp:whatsapp:account',
                'id'    => $msgId,
                'type'  => 'get',
                'to'    => 'c.us',
            ], [$modifyNode], null);

        $this->sendNode($iqNode);
    }
public function sendChangeNumber($number, $identity)
    {
        $msgId = $this->createIqId();

        $usernameNode = new ProtocolNode('username', null, null, $number);
        $passwordNode = new ProtocolNode('password', null, null, urldecode($identity));

        $modifyNode = new ProtocolNode('modify', null, [$usernameNode, $passwordNode], null);

        $iqNode = new ProtocolNode('iq',
            [
                'xmlns' => 'urn:xmpp:whatsapp:account',
                'id'    => $msgId,
                'type'  => 'get',
                'to'    => 'c.us',
            ], [$modifyNode], null);

        $this->sendNode($iqNode);
    }
public function sendChangeNumber ( $ number , $ identity ) { $ msgId = $ this -> createIqId ( ) ; $ usernameNode = new ProtocolNode ( 'username' , null , null , $ number ) ; $ passwordNode = new ProtocolNode ( 'password' , null , null , urldecode ( $ identity ) ) ; $ modifyNode = new ProtocolNode ( 'modify' , null , [ $ usernameNode , $ passwordNode ] , null ) ; $ iqNode = new ProtocolNode ( 'iq' , [ 'xmlns' => 'urn:xmpp:whatsapp:account' , 'id' => $ msgId , 'type' => 'get' , 'to' => 'c.us' , ] , [ $ modifyNode ] , null ) ; $ this -> sendNode ( $ iqNode ) ; }
Transfer your number to new one.

@param string $number
@param string $identity
Transfer your number to new one .