such as $mt->phones = "123,456";
$phonearr = explode(',', $mt->phones);
foreach ($phonearr as $phone) {
$mtlist = new List();
$mtlist->return_msgid = 1;
$mtlist->mtid = $mt->mtid;
$mtlist->phone = $phone;
echo "phone:".$phone."\n";
if (!$mtlist->save()) {
foreach ($mtlist->getMessages() as $value) {
echo $value->getMessage();
}
}
}
ablove of it output: 123 456
in list table , should be two records, but in my list table , have four records. but above of output is two.
mean foreach execute one times
but sometimes, it have two records, sometimes it have four records. no fixed.