1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?php $input = "This that then thar these them"; /* should become: This that then thar these them */ echo preg_replace('/\n(.+?)\n/','\n\t$1\n',$input); ?>
1 2 3 4 5 6
This \n\tthat \nthen \n\tthar \nthese them