Change language

PHP IntlChar :: isWhitespace () Function

A space character is considered an ICU space character if and only if it meets one of the following criteria:
  • This is a Unicode delimiter character (categories "Z" = "Zs" or "Zl" or " Zp "), but it is also not a non-breaking space (U + 00A0 NBSP or U + 2007, space or U + 202F Narrow NBSP).
  • U + 000A LINE FEED.
  • U + 000B VERTICAL TABLE.
  • U + 000C FORM FORM.
  • U + 000D RETURN.
  • U + 001C FILE SEPARATOR
  • U + 001D GROUP SEPARATOR.
  • U + 001E SEPARATOR ENTRY.
  • U + 001F UNIT SEPARATOR.
  • U + 0009 HORIZONTAL TABULATION.
Syntax:
bool IntlChar::isWhitespace ($codepoint)
Parameters :This function accepts a single $codepoint parameter which is required. The input parameter is a character or integer value encoded as UTF-8 string.Returned value:if $codepoint is a whiteSpace character according to ICU, then it returns True, otherwise it returns False.Below programs illustrate the IntlChar::isWhitespace()function in PHP: Program 1:
// PHP code for illustration
// IntlChar::iswhitespace() function 
// Enter capital letter var_dump (IntlChar::iswhitespace ( "R" ));  
// Enter a lowercase letter var_dump (IntlChar::iswhitespace ( "r" ));  
// Enter the Whitesapce character & quot; / n & quot; var_dump (IntlChar::iswhitespace ( "" )) ;  
// Enter the encoded string var_dump (IntlChar::iswhitespace ( "u {00A0}" ));  
// Enter a space character var_dump (IntlChar::iswhitespace ( "" ));  
?>
Exit :
bool (false) NULL bool (true) bool (false) bool (true)
Program 2:
// PHP code for IntlChar::iswhitespace()
// function 
// Declare the $arr array $arr = array ( "" , "" , "^" , " " , " G " );  
// run loop for each array element foreach ( $arr as $val ) { // Validate each element as code point data var_dump (IntlChar::iswhitespace ( $val )); }
?>
Exit :
bool (true) bool (true) bool (false) bool (true) NULL
Related Articles: Links: http://php.net/manual/en/iswhitespace

Shop

Gifts for programmers

Learn programming in R: courses

$FREE
Gifts for programmers

Best Python online courses for 2022

$FREE
Gifts for programmers

Best laptop for Fortnite

$399+
Gifts for programmers

Best laptop for Excel

$
Gifts for programmers

Best laptop for Solidworks

$399+
Gifts for programmers

Best laptop for Roblox

$399+
Gifts for programmers

Best computer for crypto mining

$499+
Gifts for programmers

Best laptop for Sims 4

$

Latest questions

PythonStackOverflow

Common xlabel/ylabel for matplotlib subplots

1947 answers

PythonStackOverflow

Check if one list is a subset of another in Python

1173 answers

PythonStackOverflow

How to specify multiple return types using type-hints

1002 answers

PythonStackOverflow

Printing words vertically in Python

909 answers

PythonStackOverflow

Python Extract words from a given string

798 answers

PythonStackOverflow

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

606 answers

PythonStackOverflow

Python os.path.join () method

384 answers

PythonStackOverflow

Flake8: Ignore specific warning for entire file

360 answers


Wiki

Python | How to copy data from one Excel sheet to another

Common xlabel/ylabel for matplotlib subplots

Check if one list is a subset of another in Python

How to specify multiple return types using type-hints

Printing words vertically in Python

Python Extract words from a given string

Cyclic redundancy check in Python

Finding mean, median, mode in Python without libraries

Python add suffix / add prefix to strings in a list

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

Python - Move item to the end of the list

Python - Print list vertically