Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Remove the Last Character From a String in PHP

phpCopy<?php
$mystring = "This is a PHP program.";
echo("This is the string before removal: $mystring
");
$newstring = rtrim($mystring, ". ");
echo("This is the string after removal: $newstring");
?>
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #Remove #Last #Character #From #String #PHP
ADD COMMENT
Topic
Name
6+2 =