#ZegnatAlmost. He uses strpos() to find where in the output </head> is. That is fine. strpos() will return boolean FALSE if it can’t find what it is looking for. It just so happens that FALSE == 0 so the original substr_replace() kept working even if no </head> was found.