$str = \'A|B||C|D\'; echo substr($str,0,strpos($str, \'||\')); 输出:A|B 相关文章: 2022-12-23 2022-12-23 2022-12-23 2021-11-17 2022-12-23