Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在屏幕上隐藏Whatsapi tx和rx响应输出_Php_Whatsapp_Whatsapi - Fatal编程技术网

Php 如何在屏幕上隐藏Whatsapi tx和rx响应输出

Php 如何在屏幕上隐藏Whatsapi tx和rx响应输出,php,whatsapp,whatsapi,Php,Whatsapp,Whatsapi,我在谷歌上搜索了很多次,没有找到一条答案 我使用whatsapi通过PHP发送消息 但是,当我执行包括loginwithpassword()或sendmessage()在内的任何函数时,它会以tx开头的行输出响应。我想将api集成到我的webiste中,并自动将某些输入发布到我的一些Whatsapp组中 我使用以下代码 $username = "91xxxxxxxx"; //Mobile Phone prefixed with country code so for india it will

我在谷歌上搜索了很多次,没有找到一条答案

我使用whatsapi通过PHP发送消息

但是,当我执行包括loginwithpassword()或sendmessage()在内的任何函数时,它会以tx开头的行输出响应。我想将api集成到我的webiste中,并自动将某些输入发布到我的一些Whatsapp组中

我使用以下代码

$username = "91xxxxxxxx"; //Mobile Phone prefixed with country code so for india it will be 91xxxxxxxx
$password = "Password";
$identity = strtolower(urlencode(sha1($username, true)));
$w = new WhatsProt($username, $identity, "WhatsApp Messaging", true); //Name your application by replacing "WhatsApp Messaging"
$w->connect();
$w->loginWithPassword($password);

$phone="91xxxxxxxxxxx";

$w->eventManager()->bind("onGetGroups", "onGetGroups");
$w->sendGetGroups();

function onGetGroups($phone,$groups)
{
echo "<form action='' method='POST'>";

foreach($groups as $gr){

    echo "<input type='checkbox' name='gids[]' value='$gr[id]'>$gr[id] ->   $gr[subject]<br>";
}
echo "<textarea name='msg' rows='10' cols='40'></textarea>";
echo "<input type='submit' name='gmsub' value='Send Group Message'>";
echo "</form>";


}

if(isset($_POST['gmsub'])){
$msg=$_POST['msg'];
$groupc=$_POST['gids'];

$total=count($groupc);
    for($i=0;$i<$total;$i++){
        $gId=$groupc[$i];

        $w->sendMessage($gId, $msg);
    }
}
$username=“91xxxxxxxx”//手机前缀为国家代码,因此对于印度,手机前缀为91xxxxxxxx
$password=“password”;
$identity=strtolower(urlencode(sha1($username,true));
$w=新WhatsProt($username,$identity,“WhatsApp消息传递”,true)//通过替换“WhatsApp消息”来命名应用程序
$w->connect();
$w->loginWithPassword($password);
$phone=“91xxxxxxxxxx”;
$w->eventManager()->bind(“onGetGroups”、“onGetGroups”);
$w->sendGetGroups();
功能onGetGroups($phone,$groups)
{
回声“;
foreach($gr组){
回声“$gr[id]->$gr[subject]
”; } 回声“; 回声“; 回声“; } 如果(isset($_POST['gmsub'])){ $msg=$_POST['msg']; $groupc=$_POST['gids']; $total=计数($groupc); 对于($i=0;$isendMessage($gId,$msg); } }
我不想在我的屏幕上显示如下输出

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="91xxxxxxxxxx">&£ºƒ91xxxxxxxxxn•Vv^¹ðÁ2EÎòƒ³oΡ1447256662</auth>

rx  <start from="s.whatsapp.net"></start>

rx  <stream:features></stream:features>

rx  <challenge>œÇÚ‰C¹WŒ™`¼%1Á™</challenge>

tx  <response>ó gÏD’—!°¶µpOðµ³ @³XH2înÆ/•[r</response>

rx  <success t="1447256780" props="4" kind="free" status="active" creation="1413023053" expiration="1476095053">9Ož¦n»ÃFáG¨È{'sÊM‚</success>

.................etc 
tx
德克萨斯州
德克萨斯州
德克萨斯州
德克萨斯州
德克萨斯州
德克萨斯州:1447256662
接收
接收
rxœÚ‰CŒWŒ™`¼%1Á™
txógÏD'-!°µpOðð³@XH2înÆ/•[r
rx 9OžnÃFáGÈM
等

我只想在屏幕上输出我想要的。如何抑制屏幕上的tx和rx输出?!

关闭调试模式,方法是更改第一行的最后一个参数
false
,而不是
true

完美而简单的答案@dhaval。非常感谢!我开始讨厌Stackoverflow,因为只有你应该惩罚那些消极的选民,感谢像你这样真正帮助他们的人!