PHP code example of saitamahero / condiment

1. Go to this page and download the library: Download saitamahero/condiment 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/ */

    

saitamahero / condiment example snippets


use Condiment\Evaluables\Evaluators\FluentEvaluator;

$evaluator = new FluentEvaluator();

// Basic condition evaluation
$evaluator->equals("Hello", "Hello")->evaluate(); // true

// Fluent API: chaining conditions with AND
$evaluator->contains("Hello! This is the Condiment library", "condiment")
          ->equals(1, 1)
          ->evaluate(); // true

// This results in: `contains AND equals`

// Using NOT and OR operators for complex evaluations
$evaluator->contains("Rice", "ice")
          ->orNotContains("water", "ter")
          ->evaluate(); // true

// This results in: `contains OR !contains`