![]() Example: Remove Last Comma index. so Let's see the following example with output. ![]() in this example, we will use to rtrim () function used to remove Last Comma. Im using a foreach loop to echo out some values from my database and seperating each of them by commas but I dont know how to remove the last comma it adds. Using foreach and then again using rtrim the last option from the multiple select is inserted twice in the table and what it does is trim the comma from the rtrim function. There are example to remove Last Comma from strings in PHP. I am still learning so any advice is awesome. One last question and I'm letting you off the hook. Does anyone know how to add at the end of the foreach a way to specify if it is the last entry to remove the comma? Thank you for any help you can give. ![]() I created a new template for ablums module that I am using in my cms.Įverything works great except the only thing I can't figure out is that the last image has to have no comma at the end of it. Posted: Fri 6:52 pm Post subject: Last entry in foreach remove comma
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |