Hello!

There is a string like:

1 text 132 text text. 2 Text text 456 text. 3 text text text 789. ...

You need to get through PHP to make it happen:

1. Text 123 text text. 2. Text text 456 text. 3. Text text text 789. ...

That is, put a dot after the number that is located after the tag <br />

Help to do this?

    1 answer 1

    $str = '< br />1 ะขะตะบัั‚ 132 ั‚ะตะบัั‚ ั‚ะตะบัั‚. < br />2 ะขะตะบัั‚ ั‚ะตะบัั‚ 456 ั‚ะตะบัั‚. < br />3 ะขะตะบัั‚ ั‚ะตะบัั‚ ั‚ะตะบัั‚ 789. ...'; $str = preg_replace('~(?<=/>)\d+(?=\h)~', '$0.', $str); echo $str; 

    Result:

     < br />1. ะขะตะบัั‚ 132 ั‚ะตะบัั‚ ั‚ะตะบัั‚. < br />2. ะขะตะบัั‚ ั‚ะตะบัั‚ 456 ั‚ะตะบัั‚. < br />3. ะขะตะบัั‚ ั‚ะตะบัั‚ ั‚ะตะบัั‚ 789. ... 
    • Exactly what is needed. Thank you very much, you really helped. - vladimer-velichko