PHP code example of maxvoronov / brackets-checker

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

    

maxvoronov / brackets-checker example snippets


use MaxVoronov\BracketsChecker\Checker;

$bracketsChecker = new Checker();
$bracketsChecker->check("(( ))( )");    // Returns true
$bracketsChecker->check("() )");        // Returns false

$brackets = ["(" => ")", "[" => "]", "<" => ">"];
$availableChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "-", "*", "/", " "];

$bracketsChecker = new Checker($brackets, $availableChars);
$bracketsChecker->check("([2 + 3] * <10> / (9 - 4)))");    // Returns true