Answer the question
In order to leave comments, you need to log in
Are there ready-made "compute from string" libraries?
Hello.
Please tell me the library (if any) that calculates an expression from a string, taking into account not only numbers, but also strings.
With precedence of signs and brackets.
For example $str = "Amount + (2 - 1) + something + 2+2*2+100";
Would output "Amount1ofsomething106"
Answer the question
In order to leave comments, you need to log in
echo "Количество " . (2 - 1) . " чего-то " . (2+2*2+100);
https://gist.github.com/ircmaxell/1232629
I think we can take this as a basis and modify it to fit the requirements
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question