Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好,我有一个值为 2012-21-04 的盒子。我想做的是使用 3 个选择选项来显示年、月和日。我会使用 php 来提取每个值。我将如何处理这个问题?
如果您总是使用相同类型的字符串,只需拆分字符串,使用“-”作为分隔符:
$arr_date = explode("-",$date); // $date being "2012-21-04"
$arr_date 将是一个由三个元素组成的数组,其中包含三个单独的数值
问候, 斯特凡