trim()

It strips whitespace from the beginning and end of a string

Example

<?php
echo trim(” php code “);
?>

Output

php code

Share