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.
我正在尝试在我的数据库中存储给定的时间:
我有 2 个输入小时和分钟的文本字段 - hh:mm
我需要将这些值合并到一个变量中,如下所示:
$time = hhmm00
谢谢
这应该做的工作。
$time = $_POST['hours'] . $_POST['minutes'] . "00";
从那里你会看到你可以怎么做:
$time = $_POST['hours'] . ':' . $_POST['minutes'] . ":00";//outputs 12:12:00
尝试这样的事情:
echo "{$_POST['hours']}:{$_POST['minutes']}:00";