Home  >  Article  >  Backend Development  >  请教php有没有将字符串当做公式处理数据的功能

请教php有没有将字符串当做公式处理数据的功能

WBOY
WBOYOriginal
2016-06-13 12:12:01991browse

请问php有没有将字符串当做公式处理数据的功能?
不如$a=100;
$b="$c=$a-20";
怎样处理一下就可以得到80?

------解决思路----------------------

<br />$a=100;<br />eval("\$b=\$c=$a-20;");<br />echo $b; //80<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn