How to remove space in the beginning of phrase in php?
I want to remove the white space from the beginning and after of the phrase,
$mystring = " Test Business Group Co.,Ltd ";
$mystring = "Test Business Group Co.,Ltd";
Is there anyway to do it?
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"