IntlChar::isprint() function in PHP


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

Syntax

IntlChar::isprint( val )

Parameters

  • val − An integer values or character encoded as a UTF-8 string. Required!

Return

The IntlChar::isprint() function returns TRUE if the val is a printable character

Example

The following is an example −

<?php
   var_dump(IntlChar::isprint("Kites"));
   echo "<br>";
   var_dump(IntlChar::isprint("&&"));
   echo "<br>";
   var_dump(IntlChar::isprint("K"));
?>

Output

The following is the output −

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

Example

Let us see another example −

<?php
   var_dump(IntlChar::isprint("1234"));
   echo "<br>";
   var_dump(IntlChar::isprint("1"));
   echo "<br>";
   var_dump(IntlChar::isprint("hvhj165e615"));
?>

Output

The following is the output −

NULL
bool(true)
NULL

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 30-Dec-2019

81 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements