用a减去bn值并使用php存储在c中 [英] subtracting bn values with a and store in c using php

查看:62
本文介绍了用a减去bn值并使用php存储在c中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,

plz帮我解决下面的代码工作正常但我需要的是有另一个var命名为rollno $ b数组根据rollno分隔为例如:500 ,2000,1500属于卷号:1和750,800属于卷号:2根据这个,下面的过程应该完成



$ a = 230500;

$ b =数组(500,2000,1500,1000,750,800,900,1300,2000,2500,1400,8000); //最多n个数字

foreach($ b as $ key){

$ a = $ a - $ key;

$ c = $ a;

echo $ c。'
';

}

hi frnds,
plz help me out to solve this below code works fine but wt i need is there is another var named as rollno the $b array is separated according to rollno for eg:500, 2000, 1500 belongs to roll no:1 and 750, 800 belongs to roll no:2 according to this the below process should done

$a = 230500;
$b = array(500, 2000, 1500, 1000, 750, 800, 900, 1300, 2000, 2500, 1400, 8000); //up to n number
foreach($b as $key){
$a = $a - $key;
$c = $a;
echo $c.'
';
}

推荐答案

b数组按照rollno分隔,例如:500,2000,1500属于掷号:1 750,800属于掷骰号码:2根据这个,下面的过程应该完成


b array is separated according to rollno for eg:500, 2000, 1500 belongs to roll no:1 and 750, 800 belongs to roll no:2 according to this the below process should done


a = 230500;
a = 230500;


b = array(500,2000,1500,1000,750,800,900,1300,2000,2500,1400,8000); //最多n个数字

foreach(
b = array(500, 2000, 1500, 1000, 750, 800, 900, 1300, 2000, 2500, 1400, 8000); //up to n number
foreach(


这篇关于用a减去bn值并使用php存储在c中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆