PHP code example of carthage-software / cel-php
1. Go to this page and download the library: Download carthage-software/cel-php 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/ */
carthage-software / cel-php example snippets
use Cel;
// Simple expression evaluation
$result = Cel\evaluate('1 + 2');
echo $result->getRawValue(); // Output: 3
// With variables
$result = Cel\evaluate('user.age >= 18', ['user' => ['age' => 25]]);
echo $result->getRawValue(); // Output: true