使用PHP中的sleep()函数来延迟1分钟后执行打开网址的操作。修改代码如下:

if (strpos($article, '502 Bad Gateway') !== false) {
    sleep(60); // 延迟1分钟
    header("Location: https://m.chengheshoes.com/gpp.php"); // 打开网址
    exit(); // 结束当前脚本
} else {
    // 其他操作
}

这样,如果返回的文章中包含'502 Bad Gateway'字符串,会延迟1分钟后执行打开网址的操作。注意,为了能够使用header()函数进行重定向,确保在调用header()函数之前没有输出任何内容。

PHP 延迟重定向:处理 502 Bad Gateway 错误