Convert AsciiMath to MathML.
This PHP class converts AsciiMath expressions in MathML. Since January 2023, MathML works across the latest devices and major browser versions.
PHP >= 7.0 is required.
class AsciiMathMl {
/* Methods */
public __construct(string $decimal = ".", bool $isAnnotated = true)
public parseMath(string $str, bool $isDisplay = true): string
}
require "asciimathml.php";
$parser = new AsciiMathMl();
$asciimath = "x=(-b+-sqrt(b^2-4ac))/(2a)";
$mathml = $parser->parseMath($asciimath);
This class is a port of the original asciimathml 2.2 by Peter Jipsen and other contributors.
Giovanni Salmeri.