<?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 */
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter