Computer >> Computer tutorials >  >> Programming >> PHP

IntlChar::isJavaSpaceChar() function in PHP


The IntlChar::isJavaSpaceChar() function is used to check whether the entered value is a space character or not according to Java conventions.

Syntax

IntlChar::isJavaSpaceChar(val)

Parameters

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

Return

The IntlChar::isJavaSpaceChar()function returns TRUE of val is a space character according to Java conventions.

Example

The following is an example −

<?php
   var_dump(IntlChar::isJavaSpaceChar(""));
   echo "<br>";
   var_dump(IntlChar::isJavaSpaceChar("!"));
   echo "<br>";
   var_dump(IntlChar::isJavaSpaceChar(" "));
   echo "<br>";
   var_dump(IntlChar::isJavaSpaceChar("K"));
   echo "<br>";
   var_dump(IntlChar::isJavaSpaceChar("Kite!"));
   echo "<br>";
?>

Output

The following is the output −

NULL
bool(false)
bool(true)
bool(false)
NULL