php hapus karakter terakhir dalam string
//Remove the last character using substr
$string = substr($string, 0, -1);
Kasmin Nicko
//Remove the last character using substr
$string = substr($string, 0, -1);
echo substr($string, 0, -3);
phpCopy<?php
$mystring = "This is a PHP program.";
echo("This is the string before removal: $mystring\n");
$newstring = rtrim($mystring, ". ");
echo("This is the string after removal: $newstring");
?>