PHP code example of gesparo / calculator

1. Go to this page and download the library: Download gesparo/calculator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gesparo / calculator example snippets


use Gesparo\Calculator\Calculator;

$calc = new Calculator();

$calc->add(1, 2); // 3
$calc->subtract(1, 2); // -1
$calc->multiply(1, 2); // 2
$calc->divide(1, 2); // 0.5