爲什麼我不打印「11111111111」?我解析星號ami輸出。php數組使用if語句
foreach($pieces as $val)
{
$pieces1 = explode("\n", $val);
echo ("$pieces1[0]\n");
if("$pieces1[0]" == "Response: Goodbye"){
echo("11111111111");
}
}
}
Asterisk Call Manager/1.1
Event: FullyBooted
Response: Success
Event: CoreShowChannel
Event: CoreShowChannel
Event: CoreShowChannelsComplete
Response: Goodbye
首先發生爆炸的字符串數組,然後遍歷它與一個'foreach',而不是周圍的其他方式。 – ACJ