Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing last character from a string

Status
Not open for further replies.

molly2ka

Programmer
Mar 20, 2004
27
US
Hi all,

I've been trying to think of a way to remove the last character from a string but all the functions I've come across are quite complex. The string could be of any length by the way as the variable changes pretty often. Does anyone know a simple way to do this??

Manni
 
use substr function.

Code:
$mystr = substr($string,0,strlen($string-1))


Bastien

Cat, the other other white meat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top