PHP code example of niceforbear / sparser

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

    

niceforbear / sparser example snippets


$input = 'five';
$statement = "( \$input equals 'five')";

$engine = new MarkParse($statement);
$result = $engine->evaluate($input);
print "input: $input evaluating: $statement\n";
if($result){
    print "true!\n";
}else{
    print "false!\n";
}