I am using the WhatsApp api with the link
https://github.com/WHAnonymous/Chat-API/wiki/WhatsAPI-Documentation
From this tutorial, I am using the following code to receive the messages:
$username = $get_list['userid'];
$password = $get_list['password'];
$nickname = '';
$debug = "false";
$w = new WhatsProt($username, $nickname, $debug);
try {
$w->connect();
$w->loginWithPassword($password);
$w->sendMessage($username , '');
$s = $w->pollMessage();
} catch (Exception $e) {
echo "Sorry ". $e->getMessage();
}
I am getting the messages as follow :
tx <stream:features>
tx <readreceipts></readreceipts>
tx <groups_v2></groups_v2>
tx <privacy></privacy>
tx <presence></presence>
tx </stream:features>
tx <auth mechanism="WAUTH-2" user="9195666669">����9195666669��/oNz|$%L�A#u)�1449637609</auth>
rx <start from="s.whatsapp.net"></start>
rx <stream:features></stream:features>
rx <challenge>h�.� �z�It���_�*`�P</challenge>
tx <response>����֖G�����C�NJ�qFz�o� #��NCve</response>
rx <success t="1449637762" props="4" kind="free" status="active" creation="1449574308" expiration="1481110308">Ԕ��F��>����(�]I�</success>
tx <presence name=""></presence>
tx <message to="9195666669@s.whatsapp.net" type="text" id="458GQvvffv1so0" t="1449637610" notify="">
tx <body></body>
tx </message>
rx <ib from="s.whatsapp.net">
rx <offline count="0"></offline>
rx </ib>
rx <presence from="9195666669@s.whatsapp.net"></presence>
rx <ack from="9195666669@s.whatsapp.net" class="message" id="458GdQvvfv1so0" t="1449637762"></ack>
rx <presence from="9195666669@s.whatsapp.net" type="unavailable" last="1449637445"></presence>
I have not written any print_r()
in the code then only it is printing the code. I don't want to print this code, and instead want to store it into a variable. How can I store it into a variable?