“Remova os últimos 3 caracteres do string 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

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

PHP Remova as últimas 3 letras da string

echo substr($string, 0, -3);
Jolly Jackal

Remova os últimos 3 caracteres do string php

$str = removeLast3char($str);
function removeLast3char($string){
    return trim(substr($string, 0, -3));
}
Rht

Respostas semelhantes a “Remova os últimos 3 caracteres do string php”

Perguntas semelhantes a “Remova os últimos 3 caracteres do string php”

Mais respostas relacionadas para “Remova os últimos 3 caracteres do string php” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código