Notice: Array to string conversion in /home/... on line 38

Actually, I don’t believe that to be true. I believe $phrase is the array. As $page is definitely an array, and when given to preg_replace, it will return an array.

Change echo $phrase; to print_r($phrase);

2 Likes