my code is connection.query('call addtion("'+tr+'","'+lat+'","'+long+'","'+sp+'","'+dat+'","'+start+'","'+stop+'",@phonenos,@nameofstop,@busstartstatus);SELECT @phonenos as PhoneNos;SELECT @nameofstop as NameOfStop;SELECT @busstartstatus as BusStartStatus',function(err,result){

console.log("connection.query('call addtion("'+tr+'","'+lat+'","'+long+'","'+sp+'","'+dat+'","'+start+'","'+stop+'",@phonenos,@nameofstop,@busstartstatus);SELECT @phonenos as PhoneNos;SELECT @nameofstop as NameOfStop;SELECT @busstartstatus as BusStartStatus'");


我的问题是我有


  24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A


现在仅获取lastdata,即242457658658786870D0A

最佳答案

如果给定的数据存储在数组中,那么使用foreach循环是这样的

foreach($data as $str)
{
  echo $str."<br>";
}

10-08 11:02