[Solved] How to remove space in the beginning of phrase in php? [duplicate]


You could use the trim() function which removes white spaces from the beginning and end of a string: http://php.net/manual/en/function.trim.php

$string = "   hello  world   ";
$better_string = trim($string);

-> "hello world"

solved How to remove space in the beginning of phrase in php? [duplicate]