0
I have a text that follows like this: Id - Name: Age - Phone
500 - Antonio: Age: 35 years - phone 3681-08xx
Preferences: ride a bike, travel.
1,500 - Rodrigo: Age: 20 years - phone 3685-40xx
Preferences: Play dance, read book.
I would like to put in the phrases that start with numbers the information "Id: ", to look like this:
ID: 500 - Antonio: Age: 35 years - phone 3681-08xx
Preferences: ride a bike, travel.
ID: 1.500 - Rodrigo: Age: 20 years - phone 3685-40xx
Preferences: Play dance, read book.
How do I do this with preg_replace_callback?
And how that phrase is put together?
– user60252
is a plain text, no markup, would like to search the whole text, and where to contain a sentence starting with number insert the text "ID : "
– Alê Moraes
Wouldn’t that help? http://sandbox.onlinephpfunctions.com/code/ba45ef3ae5b0d84238fcc58665d20385c1c9f5e2
– user60252
Served as a glove, thank you very much man
– Alê Moraes
I’ll put as an answer and add an explanation
– user60252