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='round(24.6,2)';
$string実行可能な構文に変換したいと思います。これを行う方法はありますか?
$string
を使用できますeval('round(24.6,2)')が、これは通常、複数の理由で嫌われます。なぜこれをしたいのですか?
eval('round(24.6,2)')
eval()
欲しい機能です。しかし: eval() は悪です!