IntlChar::isWhitespace() function in PHP


The IntlChar::isWhitespace() function checks whether the given input character is a WhiteSpace character or not.

Syntax

IntlChar::isWhitespace(val)

Parameters

  • val − A character or integer value encoded as a UTF-8 string.

Return

The IntlChar::isWhitespace()function returns TRUE if val is a WhiteSpace character.

Example

The following is an example −

<?php
   var_dump(IntlChar::iswhitespace("M"));
   echo "<br>";
   var_dump(IntlChar::iswhitespace(" "));
   echo "<br>";  
   var_dump(IntlChar::iswhitespace("& "));
   echo "<br>";
?>

Output

The following is the output −

bool(false)
bool(true)
NULL

Updated on: 30-Dec-2019

22 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements