Php String Replace First Occurrence Leetcode