<?php $id = '23423'; $s = '|'; $text = 'content to insert'; $data_update = "Some text 23423 in between end\nsome text"; $data_update = preg_replace('/\b(' . $id . '\b.*)(\R)/', '$1 ' . $text . '$2', $data_update, 1); echo $data_update;
You have javascript disabled. You will not be able to edit any code.