How to remove blank strings in php: 1. Delete all blank characters in the string through "preg_replace("/\s /", "", $var); 2. Through "preg_replace( "/\s| /", "",$var);" Remove all whitespace characters including double-width spaces.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
How to remove blank strings in php?
PHP removes whitespace characters
Example 1:
'; ?>
Example 2:
'; ?>
Recommended study:《PHP video tutorial》
The above is the detailed content of How to remove blank strings in php. For more information, please follow other related articles on the PHP Chinese website!