I have a line as shown below
$string = ' florida'
how can I remove the empty space from the beginning ONLY to form it as shown below.
$result_string = 'florida'
I'm sorry if this is too easy a question.
$string = ' florida' $result_string = ltrim($string); echo $result_string;// it will remove white spces from beganing
sounds like ltrim()- this is what you are looking for:
ltrim()
Separate spaces (or other characters) from the beginning of the line.
trim()
:
trim - ( )
, ltrim ( Oezi) ( )
$ string = trim ('florida');
echo $ string; //
: http://php.net/manual/en/function.trim.php