php8.5
Home/ Manual/ intl / intlchar/ IntlChar::ispunct

IntlChar::ispunct

PHP function Edit on GitHub ✎

(PHP 7, PHP 8)

Check if code point is punctuation character

Description

IntlChar::ispunct(int|string $codepoint): bool|null

Determines whether the specified code point is a punctuation character.

true for characters with general categories "P" (punctuation).

Parameters

codepoint

Parameter

Return Values

Returns true if codepoint is a punctuation character, false if not. Returns null on failure.

Examples

Example

php
<?php
var_dump(IntlChar::ispunct("."));
var_dump(IntlChar::ispunct(","));
var_dump(IntlChar::ispunct("\n"));
var_dump(IntlChar::ispunct("$"));

The above example will output:

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

See Also

Source: reference/intl/intlchar/ispunct.xml · from the official PHP manual (php/doc-en)