Simple PHP calculator

前端 未结 11 853
独厮守ぢ
独厮守ぢ 2020-12-14 12:01

I\'m creating a basic PHP calculator that lets you enter two values and chose your operator then displays the answer. Everything is working fine except it\'s not outputting

11条回答
  •  北荒
    北荒 (楼主)
    2020-12-14 12:48

    $first = doubleval($_POST['first']);
    $second = doubleval($_POST['second']);
    
    if($_POST['group1'] == 'add') {
        echo "$first + $second = ".($first + $second);
    }
    
    // etc
    

提交回复
热议问题