Php Find And Replace Matching Blocks