Remove whitespace from a text string using the PHP trim function
// The original text string with whitespace at the end $textString = "This is some text with a space after it "; // Remove the whitespace$trimmedTextString = trim($textString); // Display the new text stringecho $trimmedTextString; ?>