foreach

  1. abass

    برنامه نویسی گرفتن تفاضل اعداد 0

    گرفتن تفاضل اعداد 0⃣ `<?php $Monster = [150,300,450,600,750,900,1050]; $diff = []; $ba = 0; foreach($Monster as $nums){ $ba += 1; if(isset($Monster[$ba])){ $diff[$nums] = $Monster[$ba]; } } foreach($diff as $check=>$value){ if(empty($value)) unset($diff[$check]); } $end = count($diff) -...
عقب
بالا