Does anyone know how to remove the first few characters from a string and remove them in PHP.
Like in the string “str_filename” I need to remove the “str_” and save the “filename”.
But it has to remove as many charactors as it takes to get to the “_”.
In other words, i need to remove all the characters up until and including the first “_” in the string.
You can do this:
It works as you can see here: http://codepad.org/g12ENLGY
Note: The
ifis useful because your string could not have the ‘_’ char.