????:1、函數(shù)定義常量 define() 2、關(guān)鍵字定義 const define('FIRST','第一') // 訪(fǎng)問(wèn)常量 echo FIRST; const NAME = 'Jason'; echo NAME;
1、函數(shù)定義常量 define() 2、關(guān)鍵字定義 const define('FIRST','第一') // 訪(fǎng)問(wèn)常量 echo FIRST; const NAME = 'Jason'; echo NAME; // define 與 coust 的區(qū)別? //define() 可以通過(guò)變量賦值,且不能在類(lèi)中定義常量 // counst 定義常量只允許使用:標(biāo)量(整數(shù),浮點(diǎn)數(shù),布爾類(lèi)型,字符串) //可以在類(lèi)中使用定義類(lèi)常量
?? ???:西門(mén)大官人?? ??:2019-04-01 09:58:28
???? ??:總結(jié)很好,案例恰當(dāng)。注意:定義常量的關(guān)鍵字是const不是__counst