Consider the string 12345aaa. I want to use preg_split() on it so only the numeric part of it will be returned (i.e. 12345). How would I write the regex for it ?
Consider the string 12345aaa . I want to use preg_split() on it so only
Share
preg_split is not the function you want, you want
preg_matchas you don’t want to split a string into parts, but to retrieve part of it. As I don’t know more details, I can only provide a rough example of how to do it.