- ltrim: documentation ( source)
- rtrim: documentation ( source)
- preg_replace: documentation ( source)
<?php
$string = " landscape tiger ";
echo ltrim(rtrim($string));
echo $string;
$output = preg_replace('/\s+/', '%',$string);
echo $output;
?>