So assuming you want to remove everything after the last dash, you can use strrpos …in the question, this could solved by exploding on So assuming you want to remove everything after the last dash, you can use strrpos …in the question, this could solved by exploding on So assuming you want to remove everything after the last dash, you can use strrpos …in [...]