“string php remova o último caractere” 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

PHP Remova o último caractere da string

$hell = substr('hello', 0, -1);
Grepper

PHP Remova o último caractere da string se vírgula

$string = rtrim($string, ',');
Geeky Bravo

PHP Substr remove os últimos 4 caracteres

echo substr($string, 0, -3);
Helpful Hippopotamus

Remova o último caractere da string em php

$arrStr = 'Str1, Str2, str3, ';
echo rtrim($arrStr, ", "); //Str1, Str2, str3
echo substr_replace($arrStr, "", -2); //Str1, Str2, str3
echo substr($arrStr, 0, -2); // Str1, Str2, str3
@CodeGrepperManu

Respostas semelhantes a “string php remova o último caractere”

Perguntas semelhantes a “string php remova o último caractere”

Mais respostas relacionadas para “string php remova o último caractere” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código