Which function is used to strip whitespace (or other characters) from the beginning and end of a string?

Options
- trim_str
- strip_str
- strip
- trim


CORRECT ANSWER : trim

Discussion Board
Strip Whitespace

Answer : trim.

trim function is ussed to remove strip whitespace (or other character) from beginning and end of the string. trim function remove the whitespace which is before and after the value.

IamJay 02-10-2015 01:18 AM

To Vivek

$firstString = "The quick brown fox";
$secondString = " jumped over the ";
$thirdString = "lazy dog.";

echo $fourthString = $firstString . trim($secondString);


//here trim function remove the whitespace which is before and after the value of $secondSting variable.

output: The quick brown foxjumped over thelazy dog.

S.M.ZUBAIR 10-10-2014 03:58 PM

explan

sir pls give ans with explanation


vivek 07-27-2014 06:32 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement