What exactly are you trying to achieve? Your code is returning the modifed $page twice because you are calling the substr_replace() function twice.
substr_replace works like this
substr_replace( $string , $replacement, $start, $length)
So what you are doing is replacing the 9th character of the $page string with a 1, then appending the $page string again, but this time replacing the from the 3 characters from the 3rd character with the content of $start.