W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
把字符串當(dāng)成 PHP 代碼來計算:
The output of the code above will be:
eval() 函數(shù)把字符串按照 PHP 代碼來計算。
該字符串必須是合法的 PHP 代碼,且必須以分號結(jié)尾。
注釋:return 語句會立即終止對字符串的計算。
提示:該函數(shù)對于在數(shù)據(jù)庫文本字段中供日后計算而進行的代碼存儲很有用。
參數(shù) | 描述 |
---|---|
phpcode | 必需。規(guī)定要計算的 PHP 代碼。 |
返回值: | 除非在代碼字符串中調(diào)用 return 語句,則返回傳給 return 語句的值,否則返回 NULL。如果代碼字符串中存在解析錯誤,則 eval() 函數(shù)返回 FALSE。 |
---|---|
PHP 版本: | 4+ |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: