Home  >  Article  >  Backend Development  >  PHP语言,什么是空字符串?

PHP语言,什么是空字符串?

WBOY
WBOYOriginal
2016-06-23 14:26:181313browse

给个实例!


回复讨论(解决方案)

$s='';

<?php$a="";//a为空字符串$b="NULL";//这里的“NULL”也表示b为空字符串?>

长度为 0 的字符串

长度为 0 的字符串

http://learn.akae.cn/media/apas01.html

1.ASCII码表,空格(ASCII码32),并不是空字符串。对么?

<?php   $x=" ";    //空格(ASCII码32)   $y=' ';     //空格(ASCII码32)?>

对!

$x=" ";echo strlen($x); //1$y = "";echo strlen($y); //0

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn