There are two ways to do that -
1) <?php echo $output2; ?>
- you will output This cat is mine.
2) <?php echo $output1.str_replace($output1, "", $output2); ?>
I suggest that you use first example.
Anyway, please describe more what you would like to achieve.
Currently you are specifying two variables which are almost same. You can just specify one variable, which you will use.
It's something similar to this -
You have two papers, on one you have written "This cat is" and on other you have written "This cat is mine". You will cut "This cat is" from second paper and leave only "mine". So you take a glue and stick together the first paper with "mine". = You lose time and make it complicated.
If you want to get only "mine", then use - str_replace($output1, "", $output2);