Skip to navigation
How to add text after a certain sub text part with php
08.05.20
You can use preg_replace. Example: lets you say you like to add o-clock after 10:100 $text = 'The Seminar starts at 10:10 next Friday'; $pattern = '/(\d+):(\d+)/i'; $replacement = '${1}:${2} o-clock'; $new_text = preg_replace($pattern, $replacement, $text);
https://www.php.net/manual/en/function.preg-replace.php
Reply
Anonymous
Information Epoch 1732591740
Think parallel.
Home
Notebook
Contact us