I’ve got a street address like, for instance, “1234 West 23rd Street”. I’d like to blow out just the first street number and put spaces in between each number, like this: “1 2 3 4 West 23rd Street”.
Using the simple expression like "([0-9])" and replacing it with "$1 " almost works, except I want it to stop after the first space and not match, per the above example, the “23” in “23rd” as well.
This is possible with
preg_replaceand the pattern modifier ‘e’, which: