$string = "Hello World!
"; $trimmedString = htmltrim($string); echo $trimmedString; // Output: Hello World!
$string = "In both examples, the htmltrim function is used to remove any HTML tags and whitespace from the beginning and end of the string. This is useful for cleaning up user input or sanitizing data.Hello World!
"; $trimmedString = htmltrim($string); echo $trimmedString; // Output: Hello World!