PHP code example of serger / simple-formula-calculator
1. Go to this page and download the library: Download serger/simple-formula-calculator 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/ */
serger / simple-formula-calculator example snippets
Calculator::calc("5+5"); // 10
Calculator::calc("10-2"); // 8
Calculator::calc("5*2"); // 10
Calculator::calc("5+5*2"); // 20. Внимание! приоритеты не поддерживаются!
Calculator::calc("5%", 200); // 10
Calculator::calc("10+5%", 200); // 20
Calculator::calc("10+5%+20%"); // 60