PHP大小写是否敏感问题 - zzwind's Blog

PHP大小写是否敏感问题

zzwind posted @ 2010年7月16日 18:09 in php , 3565 阅读

 

一、大小写敏感

1. 变量名区分大小写

所有变量均区分大小写,包括普通变量以及$_GET,$_POST,$_REQUEST,$_COOKIE,$_SESSION,$GLOBALS,$_SERVER,$_FILES,$_ENV等;

1 <?php
2 $abc 'abcd';
3 echo $abc//输出 'abcd'
4 echo $aBc//无输出
5 echo $ABC//无输出

2. 常量名默认区分大小写,通常都写为大写

(但没找到能改变这个默认的配置项,求解)

1 <?php
2 define("ABC","Hello World");
3 echo ABC;   //输出 Hello World
4 echo abc;   //输出 abc

3. php.ini配置项指令区分大小写

如 file_uploads = 1 不能写成 File_uploads = 1

二、大小写不敏感

1. 函数名、方法名、类名 不区分大小写,但推荐使用与定义时相同的名字

1 <?php
2 function show(){
3 echo "Hello World";
4 }
5 show(); //输出 Hello World    推荐写法
6 SHOW(); //输出 Hello World
1 <?php
2 class cls{
3 static function func(){
4 echo "hello world";
5 }
6 }
7  
8 Cls::FunC();  //输出hello world

2. 魔术常量不区分大小写,推荐大写

包括:__LINE__、__FILE__、__DIR__、__FUNCTION__、__CLASS__、__METHOD__、__NAMESPACE__。

1 <?php
2 echo __line__;  //输出 2
3 echo __LINE__;  //输出 3

3. NULL、TRUE、FALSE不区分大小写

01 <?php
02 $a = null;
03 $b = NULL;
04  
05 $c = true;
06 $d = TRUE;
07  
08 $e = false;
09 $f = FALSE;
10  
11 var_dump($a == $b); //输出 boolean true
12 var_dump($c == $d); //输出 boolean true
13 var_dump($e == $f); //输出 boolean true

4.类型强制转换,不区分大小写

包括

  • (int),(integer) – 转换成整型
  • (bool),(boolean) – 转换成布尔型
  • (float),(double),(real) – 转换成浮点型
  • (string) – 转换成字符串
  • (array) – 转换成数组
  • (object) – 转换成对象
1 <?php
2 $a=1;
3 var_dump($a);  //输出 int 1
4  
5 $b=(STRING)$a;
6 var_dump($b);  //输出string '1' (length=1)
7  
8 $c=(string)$a;
9 var_dump($c);  //输出string '1' (length=1)

 

Avatar_small
JKBOSE Model Paper C 说:
2022年9月08日 19:23

JKBOSE Model Paper 2023 Class 6 Pdf Download with Answers for English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type Questions to Term1 & Term2 Exams at official website. JKBOSE Model Paper Class 6 New Exam Scheme or Question Pattern for Sammittive Assignment Exams (SA1 & SA2): Very Long Answer (VLA), Long Answer (LA), Small Answer (SA), Very Small Answer (VSA), Single Answer, Multiple Choice and etc.

Avatar_small
pavzi.com 说:
2023年4月16日 15:25

We provide you with the finest web content on each and every topic possible with help of the editorial and content team.Pavzi Post is a startup by passionate webmasters and bloggers who have a passion to provide engaging content which is accurate, interesting and worthy to read. We are more like a web community where you can pavzi.com find different information, resources, and topics on day-to-day incidents or news.

Avatar_small
civaget 说:
2023年12月14日 04:06

My revenue skyrocketed thanks to 백링크하이's expert services. A game-changer for my business.

Avatar_small
civaget 说:
2023年12月17日 19:35

제주오피 offers a fantastic array of choices. From pricing to service details, it's a one-stop-shop for officetel massages.

Avatar_small
civaget 说:
2023年12月19日 21:01

강남오피 sets the standard for relaxation with its range of services, from massages to skincare. With 70+ locations, it's a true Gangnam favorite.

Avatar_small
civaget 说:
2023年12月19日 23:14

스포츠중계's live scores and highlights keep me updated.

Avatar_small
civaget 说:
2023年12月22日 03:51

When it comes to 토토 gaming, trust 토토 Match to provide a selection of secure and enjoyable options, ensuring your peace of mind while you bet online.

Avatar_small
civaget 说:
2023年12月30日 17:39

I've been looking for ways to reduce stress and enhance my life. 휴식 and OPGuide could be the answer.

Avatar_small
civaget 说:
2024年1月15日 15:43

Some truly interesting points you have written. Aided me a lot, just what I was looking for : D. คืนยอดเสีย ทุกวัน

Avatar_small
jnanabhumiap.in 说:
2024年1月18日 18:59

JNANABHUMI AP offers the most recent information on education. The primary idea or goal of this website has been to offer comprehensive resources with information on any subject that can be accessed online. To make sure that every reader finds out what they should know about the subject they are interested in and jnanabhumiap.in links to our content.Jnanabhumi AP is a startup founded by enthusiastic bloggers and webmasters who are driven to produce interesting, factual, and well-written content. We are similar to an online community where you can find a variety of resources, information, and topics about newsworthy events or daily occurrences.

Avatar_small
SEO 说:
2024年1月23日 16:19

Thanks so much for another post. I be able to get that kind of information information. friend, and exactly. The Presidential Family

Avatar_small
SEO 说:
2024年2月01日 13:10

Hello, i just planned to drop that you a line to say that we thoroughly enjoyed this particular post from yours, I have subscribed for your RSS feed and have absolutely skimmed several of your articles or blog posts before but this blog really endured out in my situation. lpb piso wifi 10.0.0.1 pause time login

Avatar_small
how to change group 说:
2024年2月01日 18:30

Substantially, this publish is really the sweetest on this notable theme. I harmonise along with your conclusions and will thirstily seem ahead in your incoming updates. Stating thanks will not likely just be ample, for that phenomenal clarity with your writing. I will right grab your rss feed to stay informed of any updates. Admirable operate and considerably accomplishment with your enterprise dealings! Please excuse my poor English as it’s not my very first tongue.

Avatar_small
SEO 说:
2024年2月04日 15:01

I believe that a simple and unassuming manner of life is best for everyone, best both for the body and the mind. Büyükçekmece Escort

Avatar_small
biggest loser smart 说:
2024年2月05日 15:15

Excellent blog here! Also your web site loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my website loaded up as quickly as yours lol

Avatar_small
nicole 说:
2024年2月07日 14:28

Great post however , I was wanting to know if you could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit further. Bless you! murahqq

Avatar_small
seo 说:
2024年2月10日 17:23

I was curious if you ever considered changing the page layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or two pictures. Maybe you could space it out better? The exodus Effect Book

Avatar_small
seo 说:
2024年2月11日 12:24

Immigration Lawyers… [...]the time to read or visit the content or sites we have linked to below the[...]… 유흥용어

Avatar_small
seo 说:
2024年2月12日 12:32

Not often do I encounter a weblog that is both educated and entertaining, and let me tell you, you may have hit the nail on the head. Your concept is excellent; the issue is something that not sufficient individuals are speaking intelligently about. I am very happy that I stumbled across this in my quest for something relating to this. リアルドール

Avatar_small
seo 说:
2024年2月12日 16:33

After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think. Blox Fruits codes

Avatar_small
seo 说:
2024年2月12日 18:25

I am glad to be a visitor of this consummate web site! , appreciate it for this rare info ! . Nickel battery tab production

Avatar_small
seo 说:
2024年2月15日 16:38

You are a very persuasive writer. I can see this in your article. You have a way of writing compelling information that sparks much interest. خرید استئارات منیزیم؛ فروش قیمت منیزیم استئارات

Avatar_small
seo 说:
2024年2月16日 22:13

Fantastic article. Cool. bestoto88

Avatar_small
seo 说:
2024年2月22日 03:09

This is such a great post, and was thinking much the same myself. Another great update. 먹튀사이트

Avatar_small
seo 说:
2024年2月25日 12:22 Found this on MSN and I’m happy I did. Well written article. đăng ký Xanh SM Bike
Avatar_small
gamessd 66 ez 说:
2024年5月23日 21:06

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. podróże służbowe do stanów zjednoczonych

Avatar_small
robinjack 说:
2024年5月28日 19:37

Educational resources aren’t the only things a larger education franchise can provide to you. Students

Avatar_small
d 说:
2024年6月09日 02:18

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. what is the business evisa to visit india

Avatar_small
sd 说:
2024年6月19日 14:27

You may find two to three new levels inside L . a . Weight loss and any one someone is incredibly important. Initial stage may be real melting away rrn the body. lose weight panen138 agen slot online terpercaya

Avatar_small
sd 说:
2024年6月19日 21:35

I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site. us visa online requirements

Avatar_small
sd 说:
2024年6月21日 13:38

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing Clipart:t4h-x66pih4= Turkey

Avatar_small
plug play 说:
2024年6月22日 15:20

Your article has proven useful to me. It’s very informative and you are obviously very knowledgeable in this area. You have opened my eyes to varying views on this topic with interesting and solid content.

Avatar_small
sd 说:
2024年6月24日 00:23

Only aspire to mention ones content can be as incredible. This clarity with your post is superb and that i may think you’re a guru for this issue. High-quality along with your concur permit me to to seize your current give to keep modified by using approaching blog post. Thanks a lot hundreds of along with you should go on the pleasurable get the job done. Yunan vatandaÅŸları için Suudi Evisa

Avatar_small
sd 说:
2024年6月24日 00:35

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! Portekiz vatandaşları için Suudi Evisa

Avatar_small
gamessd 66 ez 说:
2024年6月26日 22:36

Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people.. Slot

Avatar_small
gam 说:
2024年6月27日 12:54

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Rock Town Single Barrel Small

Avatar_small
gamessawsd 说:
2024年6月30日 19:40

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. https://outdoorlightinglayout.mystrikingly.com/

Avatar_small
kiuversity 说:
2024年6月30日 23:25

It’s an interesting approach. I commonly see unexceptional views on the subject but yours it’s written in a pretty unusual fashion. Surely, I will revisit your website for additional information.

Avatar_small
sd 说:
2024年7月01日 23:20

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks... https://traditionalfencedesign.mystrikingly.com/

Avatar_small
sd 说:
2024年7月01日 23:20

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks... https://fundraisingsports.dorik.io/

Avatar_small
sd 说:
2024年7月02日 00:49

Thanks for this great post, i find it very interesting and very well thought out and put together. I look forward to reading your work in the future. https://ptdna.co.id

Avatar_small
sd 说:
2024年7月02日 01:06

LIVE I am continually amazed by the amount of information available on this subject. What you presented was well researched and well worded in order to get your stand on this across to all your readers. https://escaperoomexperiences.mystrikingly.com/

Avatar_small
https://escaperoomex 说:
2024年7月02日 01:06

Thank you for another great article. Where else could anyone get that kind of information in such a perfect way of writing? I have a presentation next week, and I am on the look for such information.

Avatar_small
https://sunsetplumbi 说:
2024年7月02日 01:07

I am continually amazed by the amount of information available on this scdcubject. What you presented was well researched and well worded in order to get your stand on this across to all your readers.

Avatar_small
sam khan 说:
2024年7月02日 19:34

I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. تأشيرة كندا عبر الإنترنت

Avatar_small
https://sunsetplumbi 说:
2024年7月03日 01:42

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. HAHM

Avatar_small
gamessawsd 说:
2024年7月03日 12:35 This is very interesting content! I have thoroughly enjoyed reading your points and have come to the conclusion that you are right about many of them. You are great. HAHM
Avatar_small
https://sunsetplumbi 说:
2024年7月04日 00:47

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. logistics service

Avatar_small
https://sunsetplumbi 说:
2024年7月04日 23:04

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. click articles

Avatar_small
https://sunsetplumbi 说:
2024年7月10日 02:14

I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! Algeriets-ambassade-i-Indien

Avatar_small
seo 说:
2024年7月13日 19:25

Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this. click here

Avatar_small
https://sunsetplumbi 说:
2024年7月14日 01:23

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. https://atcancelthings.wordpress.com/


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee