i具有数据阵列DINAMIC,
$methods = [];
$result [] = ''; //result callculate save this variable;
foreach($data as $key=>$val){
$methods[]= $val['list_method'];
}
我有一个数组,我正在循环,结果如下所示:
Array
(
[0] => Array
(
[rekomendasi] => 1
[select] => 236
[method] => Array
(
[0] => Array
(
[id] => 0
[rating] => 0
)
[1] => Array
(
[id] => 629
[rating] => 443.2
)
)
)
[1] => Array
(
[rekomendasi] => 1
[select] => 234
[method] => Array
(
[0] => Array
(
[id] => 620
[rating] => 343.43
)
[1] => Array
(
[id] => 628
[rating] => 345.772
)
)
)
)
1
在这种情况下,我根据索引进行计算。我做了一个如下的示例:
$result1 = 1 / (1 + (pow( 10 , ( index[0][method][0][rating] - index[0][method][1][rating])/400);
$result2 = 1 / (1 + (pow( 10 , ( index[1][method][0][rating] - index[1][method][1][rating])/400);
以前我做了代码,但我仍然对如何使计算动态感到困惑?
感谢
1条答案
按热度按时间iszxjhcz1#
尝试下一个代码...