<?php // A message stored in a string $statusMessage = "Process completed#"; // Remove the last symbol from the message $cleanMessage = substr($statusMessage, 0, -1); // Display the messages echo "Before cleanup: " . $statusMessage . "\n"; echo "After cleanup: " . $cleanMessage . "\n"; // Here is the output /* Before cleanup: Process completed# After cleanup: Process completed */