常量在使用前必须要定义,否则程序执行会出错。在php中使用define()函数来定义常量。
1、语法格式:define("常量名称","常量的值");
例如:define("php360","完美的php");
下面还是来一个范例吧:
define()函数定义一个常量,常量类似变量,不同之处在于:在设定以后,常量的值无法更改,常量名不需要开头的美元符号($),作用域不影响对常量的访问,常量值只能是字符串或数字.
语法:define(name,value,case_insensitive)
name 必需,规定常量的名称,value 必需,规定常量的值,case_insensitive 必需,规定常量的名称是否对大小写敏感,若设置为 true,则对大小写不敏感,默认是 false(大小写敏感)。
- define("greeting","hello world!");
- echo constant("greeting");
运行这段代码,就会在浏览器输出 hello world! 的结果。
2、常量命名的规则:以字母或下划线开始,后面可以跟任何字母、数字、下划线。
3、常量与变量的不同之处:
(1)常量前面没有$符号,而变量必须以$符号开头。
(2)常量只能用define()函数来定义,不能通过赋值语句定义。
(3)常量可以不用理会变量范围的规则,可以在任何地方定义和访问。
(4)常量一旦被定义就不能够重新定义或取消定义,并且值不能发生改变,而变量的值可以随时发生改变。
(5)常量的值只能是标量,即整型、浮点型、字符串3种类型
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php define常量定义与变量区别
波比源码 » php define常量定义与变量区别
buy generic levaquin 250mg order levaquin 250mg online cheap
buy dutasteride generic zofran 4mg pills buy zofran 4mg online cheap
aldactone drug order diflucan 200mg generic buy diflucan 200mg
buy ampicillin 250mg pills cephalexin 500mg brand buy erythromycin 250mg online cheap
fildena 100mg cheap buy sildenafil pills robaxin 500mg pill
sildenafil tablet sildenafil mail order usa estrace pills
buy generic lamotrigine mebendazole over the counter order tretinoin without prescription
buy tadalafil 20mg sale purchase tadalafil pill order diclofenac 50mg
order isotretinoin 10mg generic order azithromycin 500mg generic azithromycin online
cialis coupons canada pharmacy buy sildenafil
order prednisone 20mg generic 5mg cialis viagra us
tadalafil ohne rezept viagra 200mg fГјr frauen viagra fГјr frauen
order modafinil 200mg online Overnight cialis order generic diamox 250mg
catapres cost catapres usa spiriva price
buspirone 5mg without prescription cordarone 100mg brand ditropan without prescription
order terazosin without prescription order azulfidine 500 mg sale order sulfasalazine 500mg generic
order alendronate 70mg pills panadol over the counter oral pepcid 40mg
benicar 20mg oral purchase olmesartan pill acetazolamide 250mg pill
cheap imdur 40mg order imuran 25mg telmisartan 80mg for sale
order molnupiravir 200 mg generic omnicef 300mg uk prevacid 30mg pill
order zoloft 50mg online cheap order escitalopram 10mg for sale viagra order
salbutamol 100 mcg pills sildenafil citrate 50 mg viagra 50mg tablet
cialis 5mg usa buy fluoxetine 20mg generic sildenafil 20 mg
naltrexone 50mg cost cost letrozole 2.5mg purchase abilify online cheap
buy generic provera medroxyprogesterone brand buy cyproheptadine 4mg pill
purchase fluvoxamine pill order luvox 100mg pill order glipizide 10mg pills
furosemide drug order furosemide for sale hydroxychloroquine cheap
buy viagra 100mg sale cost sildenafil 50mg order lisinopril 10mg online
zyvox 600 mg oral linezolid cost online slots for real money
order omeprazole 20mg online casino games for real money online poker
lopressor 50mg tablet levitra 10mg for sale vardenafil canada
i need help with my research paper real casino slots money slots
i need a paper written for me websites to write essays cost of viagra 100mg
order clomiphene 50mg online cheap best online casino best online casino real money
dapoxetine 60mg cheap cheap levothyroxine online synthroid 75mcg for sale
tadalafil 20mg sildenafil mail order us sildenafil professional
orlistat 120mg cheap xenical 120mg tablet order zovirax 800mg
tadalafil medication cialis 20mg sale purchase clopidogrel
allopurinol 100mg brand ezetimibe sale cost zetia 10mg
buy generic methotrexate 5mg warfarin pills order reglan 10mg pills
baclofen 25mg price oral tizanidine buy toradol 10mg generic
sumatriptan us order levofloxacin generic buy avodart generic
zantac 300mg uk order celecoxib 100mg celebrex without prescription
play blackjack online for real money best online casinos that payout free casino
order tamsulosin 0.4mg online cheap zofran 8mg drug generic aldactone 100mg
order metronidazole generic buy augmentin 625mg bactrim online
order cephalexin 125mg online cheap erythromycin 500mg pill erythromycin online buy
sildenafil pills 100mg sildalis for sale brand lamotrigine
cheap sildenafil 50mg cialis india order tadalafil 10mg generic
purchase azithromycin online cheap buy gabapentin 800mg for sale buy gabapentin 100mg pills
real money slot machines ed remedies buy tadalafil 10mg pills
purchase lasix pills hydroxychloroquine 400mg drug hydroxychloroquine 400mg us
buy prednisone 10mg online cheap buy minipress 2mg generic vermox medication
fildena 100mg uk nolvadex 10mg for sale budesonide pills
tadacip for sale buy indomethacin for sale indomethacin 50mg brand
purchase terbinafine sale suprax 100mg oral amoxicillin 250mg drug
actos 30mg brand order viagra 100mg generic brand sildenafil
cost altace 10mg buy arcoxia 60mg etoricoxib online buy
cost mesalamine 400mg purchase mesalamine pill order avapro 300mg pills
diamox order online buy diamox without prescription imuran 50mg without prescription
digoxin 250 mg without prescription telmisartan 20mg without prescription molnunat 200 mg uk
carvedilol 25mg without prescription buy oxybutynin without prescription buy amitriptyline 50mg
cheap amoxil generic order generic stromectol 6mg cost for ivermectin 3mg
purchase famotidine without prescription cost pepcid 40mg purchase remeron generic
Great post thank you. Hello Administ . Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
esomeprazole generic esomeprazole 40mg uk order lasix 40mg
minocin 50mg uk terazosin 5mg canada buy terazosin 5mg online cheap
glucophage brand buy metformin 500mg nolvadex without prescription
modafinil 100mg canada order phenergan online cheap order promethazine 25mg without prescription
brand deltasone 10mg order accutane 10mg amoxil canada
isotretinoin 20mg for sale accutane 20mg oral ampicillin 250mg pill
buying ed pills online purchase pregabalin sale buy generic proscar 5mg
stromectol 3 mg dosage order deltasone 10mg for sale order prednisone online cheap
buy generic albuterol clavulanate tablet augmentin 375mg drug
buy prednisolone 10mg without prescription furosemide 100mg usa order lasix 40mg pills
dutasteride price order xenical 120mg sale orlistat 120mg ca
buy doxycycline 200mg generic purchase levitra generic buy generic zovirax
purchase azathioprine pills order telmisartan pills naprosyn 250mg brand
omnicef over the counter generic protonix 40mg buy protonix 20mg sale
zocor 10mg pill order promethazine 25mg pills order sildalis pill
dapsone online order mesalamine pills purchase atenolol sale
brand viagra viagra sildenafil 50mg cialis without prescription
buy alfuzosin pills diltiazem 180mg for sale diltiazem ca
order promethazine 25mg online cheap provigil without prescription usa cialis sales
order warfarin 5mg sale purchase coumadin pill allopurinol usa