Php remover o último caracteres do texto

Exemplos de código

8
0

remover a última letra php

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

php remover o último carácter do texto

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

subestr do php remover os últimos 4 caracteres

echo substr($string, 0, -3);
2
0

remover o último carácter do texto 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
0
0

php remover o último caracteres do texto

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

php remover o último carácter do texto se vírgula

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

Páginas relacionadas

Páginas semelhantes com exemplos

Em outros idiomas

Esta página está em outros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................