Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 PHP 中将字符串等公式转换为其计算值。
例如:
$str = "(20000+(2000*(40/100)))*(10/100)"; $calculated_value = ????; // Calculated value of the above string "$str".
我需要计算字符串“$str”的值并将其存储在单独的字符串中。请帮帮我。
提前致谢。
看看这个:http ://www.phpclasses.org/package/2695-PHP-Safely-evaluate-mathematical-expressions.html
并在php中处理数学方程