我有一系列分数:
$fractions = array('1/8', '1/4', '1/2');
Run Code Online (Sandbox Code Playgroud)
有什么方法可以让PHP实际执行除法获得小数值?
就像是:
foreach($fractions as $value) {
$decimal = [the result of 1 divided by 8, or whatever the current fraction is in value];
}
Run Code Online (Sandbox Code Playgroud) php ×1