PHP code example of windwalker / compare

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

    

windwalker / compare example snippets

 php
echo new GteCompare('published', '1');
 php
$conditions = array(
    GteCompare('published', '1'),
    EqCompare('entry_id', 25),
    LteCompare('date', $query->quote($date))
);

$sql = 'WHERE ' . implode(' AND ' , $conditions);
 php
$compare = new GteCompare(3, '1');

$result = $compare->compare();

var_dump($result); // bool(true)