php trim spaces before and after string code example
Example: php remove space before and after string
$words = ' my words ';
$words = trim($words);
var_dump($words);
// string(8) "my words"
$words = ' my words ';
$words = trim($words);
var_dump($words);
// string(8) "my words"