php 5.5 substructure

preg_replace_callback created to remove depreciation error in php 5.5