Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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::ispunct() function in PHP
The IntlChar::ispunct() function check whether the given input character is a punctuation character or not.
Syntax
bool IntlChar::ispunct(val)
Parameters
val − An integer value or character encoded as a UTF-8 string. Required!
Return
The IntlChar::ispunct()function returns TRUE if the val is a punctuation character.
Example
The following is an example −
<?php
var_dump(IntlChar::ispunct("1"));
echo "<br>";
var_dump(IntlChar::ispunct(","));
echo "<br>";
var_dump(IntlChar::ispunct("q"));
?>
Output
The following is the output −
bool(false) bool(true) bool(false)
Example
Let us see another example −
<?php
var_dump(IntlChar::ispunct(";"));
echo "<br>";
var_dump(IntlChar::ispunct(":"));
echo "<br>";
var_dump(IntlChar::ispunct("10"));
?>
Output
The following is the output −
bool(true) bool(true) NULL
Advertisements