PHP code example of fw3 / applications

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

    

fw3 / applications example snippets




use fw3\applications\calculator\InfixCalculator;

var_dump([
    InfixCalculator::calculate('1 + 2 - 3 * 4 / 5'),
    InfixCalculator::calculate('1 + 2 - 3 * 4 / 5 % 6'),
    InfixCalculator::calculate('(SUM(1,2,3) + 4 - MIN(1,2,3)) * MAX(1,2,3) / POW(2,POW(2,1))'),
]);

var_dump([
    InfixCalculator::calculate('A1 + B2', ['A1' => 1, 'B2' => 2]),
]);



use fw3\applications\calculator\PostfixCalculator;

var_dump([
    PostfixCalculator::calculate('1 2 + 3 4 * 5 / -'),
    PostfixCalculator::calculate('12 34 +'),
    PostfixCalculator::calculate(SUM(1,2,3) 4 + MIN(1,2,3) - MAX(1,2,3) * POW(2,POW(2,1)) /'),
]);

var_dump([
    PostfixCalculator::calculate('A1 B2 +', ['A1' => 1, 'B2' => 2]),
]);