I have a string in PHP that I would like to split. This string is concatenation of ID numbers from the database.An example of the string is below but it could be much long with each ID separated by "_": ID_1_10_11_12I would like to split the string into the following:ID_1_10_11_12ID_1_10_11ID_1_10ID_1Then concatenate them in a new string reversed in order and then separated by spaces:new string = "ID_1 ID_1_10 ID_1_10_11 ID_1_10_11_12"I cant figure this out. I have tried exploding the original value into an array by "_" but that just leaves me with the numbers. I would appreciate any advice on how I should approach this. For reference these ID's written to the class value of a checkbox so that parent and child values can be grouped and then manipulated by a jquery function.