remove space from start and end of string in php
snippet in php

remove empty spaces php

user5248

$string = str_replace(' ', '', $string);

remove space from string php

user6131

<?php
$stripped = str_replace(' ', '', "10 1000 0000 000");
echo $stripped;

remove space from start and end of string in php

user2058

 
$trimmed = trim($text);
var_dump($trimmed);