hellow,
im looking for a way to cut off the last character of a string.
the string is an array, en ends with a comma.
Thats what i want to cut off, the comma.
Anyone knwos how?
friendly greetz,
tom
cut off last character of strinf
Moderator: General Moderators
- potato
- Forum Contributor
- Posts: 192
- Joined: Tue Mar 16, 2004 8:30 am
- Location: my lovely trailer, next to the big tree
ok, it works. Thank you very much
here's the code for if anyone has the same problem:
note that the -1 stands for minus 1 character at the end of the string.
So if your string is
this is my string
the result would be
this is my strin
if you want to cut 2 character, replmace the -1 with -2
here's the code for if anyone has the same problem:
Code: Select all
$pics = substr ($pics, 0, -1);So if your string is
this is my string
the result would be
this is my strin
if you want to cut 2 character, replmace the -1 with -2