“PHP Remova o último caractere da string se vírgula” 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 vírgula do string php

rtrim($my_string, ',');
Indian Gooner

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

PHP Remova as últimas 3 letras da string

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

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 “PHP Remova o último caractere da string se vírgula”

Perguntas semelhantes a “PHP Remova o último caractere da string se vírgula”

Mais respostas relacionadas para “PHP Remova o último caractere da string se vírgula” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código