<legend id='NTgXN'><style id='NTgXN'><dir id='NTgXN'><q id='NTgXN'></q></dir></style></legend>
  • <i id='NTgXN'><tr id='NTgXN'><dt id='NTgXN'><q id='NTgXN'><span id='NTgXN'><b id='NTgXN'><form id='NTgXN'><ins id='NTgXN'></ins><ul id='NTgXN'></ul><sub id='NTgXN'></sub></form><legend id='NTgXN'></legend><bdo id='NTgXN'><pre id='NTgXN'><center id='NTgXN'></center></pre></bdo></b><th id='NTgXN'></th></span></q></dt></tr></i><div id='NTgXN'><tfoot id='NTgXN'></tfoot><dl id='NTgXN'><fieldset id='NTgXN'></fieldset></dl></div>

        <bdo id='NTgXN'></bdo><ul id='NTgXN'></ul>

        <tfoot id='NTgXN'></tfoot>
      1. <small id='NTgXN'></small><noframes id='NTgXN'>

        null 和 empty 和有什么不一样?

        What is the difference between null and empty?(null 和 empty 和有什么不一样?)

        <i id='4tRZA'><tr id='4tRZA'><dt id='4tRZA'><q id='4tRZA'><span id='4tRZA'><b id='4tRZA'><form id='4tRZA'><ins id='4tRZA'></ins><ul id='4tRZA'></ul><sub id='4tRZA'></sub></form><legend id='4tRZA'></legend><bdo id='4tRZA'><pre id='4tRZA'><center id='4tRZA'></center></pre></bdo></b><th id='4tRZA'></th></span></q></dt></tr></i><div id='4tRZA'><tfoot id='4tRZA'></tfoot><dl id='4tRZA'><fieldset id='4tRZA'></fieldset></dl></div>
          • <tfoot id='4tRZA'></tfoot>

            1. <small id='4tRZA'></small><noframes id='4tRZA'>

                • <bdo id='4tRZA'></bdo><ul id='4tRZA'></ul>
                  <legend id='4tRZA'><style id='4tRZA'><dir id='4tRZA'><q id='4tRZA'></q></dir></style></legend>
                    <tbody id='4tRZA'></tbody>

                  本文介绍了null 和 empty 和有什么不一样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我对空和空的概念很陌生.虽然我已经努力了解它们之间的区别,但我更加困惑.我在 http://www.tutorialarena.com/blog/php-isset- 上看到了一篇文章vs-empty.php 但是我仍然没有看到您在验证表单时何时会使用 isset 和 empty .看不懂区别,不想用错的功能,也不想用其他方面的功能.有人可以举例帮助我理解吗?我对编码非常陌生,所以如果有人能给我提供真实世界的例子,同时保持它足够简单以供新手遵循,我将不胜感激.

                  I am new to the concept of empty and null. Whilst I have endeavoured to understand the difference between them, I am more confused. I came across an article at http://www.tutorialarena.com/blog/php-isset-vs-empty.php however I still don't see when you would use isset and empty when validating forms. Seeing that I don't grasp the difference, I don't want to be using the incorrect functions as well as not be able to use the functions in other areas. Can someone give examples that will help me understand? I am very new to coding so would appreciate if someone could give me real world examples and at the same time keep it simply enough for noob to follow.

                  推荐答案

                  一个变量是 NULL 如果它没有值,并且不指向内存中的任何地方.

                  A variable is NULL if it has no value, and points to nowhere in memory.

                  empty() 更像是 empty 的字面意思,例如字符串 "" 为空,但 not NULL.

                  empty() is more a literal meaning of empty, e.g. the string "" is empty, but is not NULL.

                  以下几点被认为是为空:

                  The following things are considered to be empty:

                  • ""(空字符串)
                  • 0(0 作为整数)
                  • 0.0(0 作为浮点数)
                  • "0" (0 作为字符串)
                  • 错误
                  • array()(空数组)
                  • var $var;(声明了一个变量,但在类中没有值)

                  来源.

                  $aNULL.

                  $a = ''empty,但不是 NULL.

                  如果 $a='' 为空但不是 NULL,我什么时候使用 empty() 函数,什么时候使用isset() 函数.

                  If $a='' is empty but not NULL, when do I use the empty() function and when do I use the isset() function.

                  isset() 将返回 FALSE 是指向 NULL 的变量.

                  当您了解什么是 empty 时,请使用 empty()(查看上面的列表).

                  Use empty() when you understand what is empty (look at the list above).

                  另外,当你说它在内存中无处指向时,这究竟是什么意思?

                  Also when you say it points nowhere in memory, what does that mean exactly?

                  这意味着 $str = '' 将作为长度为 0 的字符串存在于内存中.

                  It means that $str = '' will be in memory as a string with length of 0.

                  如果是$str = NULL,就不会占用内存.

                  If it were $str = NULL, it would not occupy any memory.

                  这篇关于null 和 empty 和有什么不一样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  • <bdo id='9fb6d'></bdo><ul id='9fb6d'></ul>
                        <tbody id='9fb6d'></tbody>
                    1. <i id='9fb6d'><tr id='9fb6d'><dt id='9fb6d'><q id='9fb6d'><span id='9fb6d'><b id='9fb6d'><form id='9fb6d'><ins id='9fb6d'></ins><ul id='9fb6d'></ul><sub id='9fb6d'></sub></form><legend id='9fb6d'></legend><bdo id='9fb6d'><pre id='9fb6d'><center id='9fb6d'></center></pre></bdo></b><th id='9fb6d'></th></span></q></dt></tr></i><div id='9fb6d'><tfoot id='9fb6d'></tfoot><dl id='9fb6d'><fieldset id='9fb6d'></fieldset></dl></div>

                      <small id='9fb6d'></small><noframes id='9fb6d'>

                    2. <legend id='9fb6d'><style id='9fb6d'><dir id='9fb6d'><q id='9fb6d'></q></dir></style></legend>

                        <tfoot id='9fb6d'></tfoot>