我必须从产品描述中删除外部 URL,这是一个示例:
佳能 NB-5L 摄像机移动电源: https ://www.esseshop.it/caricabatterie-universale-da-auto-rete-fotocamera-videocamera-p-4452.html
所以我必须用正则表达式删除以 http 开头并以 .html 或 .htm 结尾的每个子字符串
$str = "Powerbank for videocamera Canon NB-5L: https://www.esseshop.it/caricabatterie-universale-da-auto-rete-fotocamera-videocamera-p-4452.html";
preg_replace('(http)|(.html)|(.htm)', '$1', $str, 1);