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

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

WBOY
Release: 2016-06-23 14:26:18
Original
1378 people have browsed it

给个实例!


回复讨论(解决方案)

$s='';

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

长度为 0 的字符串

长度为 0 的字符串

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

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

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

对!

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template