PHP code example of zkyg / spreadsheet-formula-laravel

1. Go to this page and download the library: Download zkyg/spreadsheet-formula-laravel 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/ */

    

zkyg / spreadsheet-formula-laravel example snippets


$formula = "=IF( [[value1]] < 5, \"ok\", [[value1]] + [[value2]] )";
$values = [
    'value1' => 7,
    'value2' => 3
];
$res = \zkyg\SpreadsheetFormulaLaravel\SpreadsheetFormulaParser::getInstance()->calculate(
    $formula,
    $values
);
// $res = 10