Hi folks, I’m trying to extend the usage of a snippet so I can include multiple values in a field. I need to then use preg_match to strip the value down depending on the piece that is needed.
I have stored a value in a field that has a pattern to separate the needed sections but I need help with stripping out what is not needed.
the pattern is as follows.
value1 = john//10
value2 = bob//20
I need to use preg_replace to say, take out everything before the // including the // as well so I’m left with just the numbers at the end.
I managed to get to display john10 using
preg_replace('/[a-zA-Z0-9]\/[^0-9]/i', '', $string); but still can’t remove the info before the //. If someone could give me an idea of how to do that. I did read a few tuts on regex but can’t seem to quite get it.
I have tried all sorts but I’m not very good with regex
Thanks.