1. Go to this page and download the library: Download markjaquith/wherewithal 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/ */
markjaquith / wherewithal example snippets
use MarkJaquith\Wherewithal\{Parser, Config};
$config = (new Config)
->addOperators('<', '>', '<=', '>=', '=', '/') // Or add a subset.
->addColumn('column_name', 'column_alias1', 'column_alias2')
->addColumn('quantity')
->addColumn('price', 'cost');
$parser = new Parser($config);
$structure = $parser->parse('quantity > 5 and (price < 3.00 or column_alias2 = 10'));
$structure->toString();
/*
string(57) "quantity > ? and ( price < ? or price / column_name = ? )"
*/
$structure->getBindings()]);
/*
array(3) {
[0]=>
string(1) "5"
[1]=>
string(4) "3.00"
[2]=>
string(2) "10"
}
*/