Home>

The trim () function in php is defined as follows:

trim (string, charlist)

The parameters are described as follows:

string is required. Specifies the string to be checked.

charlist

Optional. Specifies which characters are removed from the string.If omitted,Remove all of the following characters:

"\ 0"-null

"\ t"-tab

"\ n"-newline

"\ x0b"-vertical tab

"\ r"-carriage return

""-Space

The sample code is as follows:

<?php
 echo trim ($str);
 echo "<br />";
 echo trim ($str, "\ r \ r (::)");
?>

The results are as follows:

php
  • Previous Java implements HTTP Post, Get, proxy access requests
  • Next My main new features of PHP 70