PHP Remove Whitespace from Beginning and End of String Example
Now, let's see an example of php remove whitespace from beginning and end of string. I would like to share with you php remove space from beginning and end of string. let’s discuss about how to remove space from start and end of string in php. We will look at an example of remove first and last space from string in php.
We will use trim() php function to remove space from start to end of string in php. you can also use this example with laravel. so, let's see the simple example code with output.
$myString = " Hello ItSolutionStuff.com ";
$newString = trim($myString);
string(25) "Hello ItSolutionStuff.com"
I hope it can help you...
We are Recommending you
- How to Get Previous Month from Date in PHP?
- How to Get HTML Tag Value in PHP?
- MySQL Query to Get Current Year Data Example
- How to Remove White Space from String in PHP?
- How to Quick Run PHP Project on Localhost?
- How to Check If String is URL or Not in PHP?
- How to Convert Array Key to Lowercase in PHP?
- How to Upload Image using jQuery Ajax in PHP?
- How to Remove Empty Values from Array in PHP?
- How to Get Minimum Key Value of Array in PHP?
- How to access PHP variables in JQuery?
- How to Count Number of Files in a Directory in PHP?
- How to Find Day Name from Specific Date in PHP?
- How to Remove Null Values from Array in PHP?