Introduction
In this article I describe the PHP string functions chop, chr and chunk_split . To learn some other math functions, go to:
1 String Functions in PHP: Part1
PHP chop() Function
The PHP string chop function will remove a white space or other predefined character from the right end of a string.
Syntax
| chop( string, charlist) |
Parameter in chop Function
The parameters of the chop function are:
| Parameter | Description |
| string | It specifies the string to check. |
| charlist | It specifies when you want, which character is removed from the string. |
Example
An example of the chop function is:
<?php
$str = "Welcome at MCN Solution!\n\n";
echo $str;
echo chop($str);
?>
Output
PHP chr() Function
The PHP string chr function returns a specific character.
Syntax
| chr( ascii) |
Parameter in chr Function
The parameter of the chr function is:
| Parameter | Description |
| ascii | It specifies an ASCII value. |
Example
An example of the chr function is:
<?php



Join the conversation! Your thoughts help the community grow.