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 中操作 String 中存在的运算符。例如:
$a = "3 + 2";
有可能得到5的结果吗?类似的 $a 也可以有其他值,如
$a = "3 - 2 "; or $a = "3 * 2";
在每种情况下,我都想要适当的结果。但是一个操作员将始终在中心的字符串中。要求是,我想知道字符串中存在的运算符是否可以被操纵。
提前致谢
你需要使用eval. 这是一个内置在 php.ini 中的函数。
eval
http://php.net/manual/en/function.eval.php
我正在使用 jQuery 来让一些 div 在我的本地服务器上显示/隐藏。现在它在测试页面上工作正常但是当我每次使用时将它放入我的测试应用程序(用 PHP 和 HTML 编写)
<a href="#"
创建一个钩子,它实际上也链接了 locahost