- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
IntlChar::iscntrl() function in PHP
The IntlChar::iscntrl() function is used to check the given input is a control character or not. Examples include line feed (
), tab (\t), etc.
Syntax
IntlChar::iscntrl( val )
Parameters
val − An integer values or character encoded as a UTF-8 string.
Return
The IntlChar::iscntrl() function returns TRUE if the val is a control character.
Example
The following is an example −
<?php var_dump(IntlChar::iscntrl("
")); echo "<br>"; var_dump(IntlChar::iscntrl("ahjh")); echo "<br>"; var_dump(IntlChar::iscntrl("12345")); ?>
Output
The following is the output −
bool(true) NULL NULL
Example
Let us now see another example wherein we are checking whether the entered value is a control character or not −
<?php var_dump(IntlChar::iscntrl("\r")); echo "<br>"; var_dump(IntlChar::iscntrl("878")); echo "<br>"; ?>
Output
The following is the output −
bool(true) NULL
Advertisements