I have a string like
a,b,c,d,e,
I would like to remove last ',' and get the remaining string back
OUTPUT: a,b,c,d,e
Here is what i did
echo rtrim("a,b,c,d,e,", ",")
Hope it helps ^^
Revisions
- April 13, 2017 @ 17:15:46 [Current Revision] by Sharing Solution
- April 13, 2017 @ 17:15:46 by Sharing Solution
- April 13, 2017 @ 17:15:36 by Sharing Solution
Revision Differences
April 13, 2017 @ 17:15:36 | Current Revision | ||
---|---|---|---|
Content | |||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: I have a string like | Unchanged: I have a string like | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <pre> | Unchanged: <pre> | ||
Unchanged: <code>a,b,c,d,e,< /code></pre> | Unchanged: <code>a,b,c,d,e,< /code></pre> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: I would like to remove last ',' and get the remaining string back | Unchanged: I would like to remove last ',' and get the remaining string back | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <pre> | Unchanged: <pre> | ||
Unchanged: <code>OUTPUT: a,b,c,d,e</code></pre> | Unchanged: <code>OUTPUT: a,b,c,d,e</code></pre> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: Here is what i did | Unchanged: Here is what i did | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Deleted: echo rtrim("a,b,c,d,e,", ",") | Added: <strong>echo rtrim("a,b,c,d,e,", ",")</strong> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: | Unchanged: | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: Hope it helps ^^ | Unchanged: Hope it helps ^^ | ||
Unchanged: </p> | Unchanged: </p> |
Note: Spaces may be added to comparison text to allow better line wrapping.
No comments yet.