“Remova o último caractere de uma string no PHP” Respostas de código

PHP Remova o último caractere em string

//Remove the last character using substr
$string = substr($string, 0, -1);
Kasmin Nicko

Remova a última letra php

<?php
echo substr('abcdef',0, -1);     // abcde
?>
Vast Vulture

Remova o último caractere de uma string no PHP

phpCopy<?php
$mystring = "This is a PHP program.";
echo substr($mystring, 0, -1);
?>
CodeGuruDev

Remova o último caractere de uma string no PHP

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");
?>
CodeGuruDev

Respostas semelhantes a “Remova o último caractere de uma string no PHP”

Perguntas semelhantes a “Remova o último caractere de uma string no PHP”

Mais respostas relacionadas para “Remova o último caractere de uma string no PHP” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código