<?php $str = 'The quick brown fox jumps over the lazy dog'; echo preg_replace_callback('/fox|dog/', function($matches){ $a = $matches[0]; return '=>'.$a[0].'...'.$a[strlen($a)-1].'<='; }, $str);
You have javascript disabled. You will not be able to edit any code.