如何在数组中插入当前日期

I'm trying to insert the current date into a database for each entry within an array. I've found documentation for inserting the current date, but nothing that explains how to do it within an array.

<?php

$connect = new PDO("mysql:host=localhost;dbname=testing", 
"root", "");

$query = "
INSERT INTO tbl_test 
(full_name, id_number, email, pin_rank, team_name) 
VALUES (:full_name, :id_number, :email, :pin_rank, :team_name)
";

for($count = 0; $count<count($_POST['hidden_full_name']); $count++)
{
 $data = array(
     ':full_name' => $_POST['hidden_full_name'][$count],
     ':id_number' => $_POST['hidden_id_number'][$count],
     ':email' => $_POST['hidden_email'][$count],
     ':pin_rank' => $_POST['hidden_pin_rank'][$count],
     ':team_name' => $_POST['hidden_team_name']
 );
 $statement = $connect->prepare($query);
 $statement->execute($data);
}

?>

I would like the current date to display in the last column within the table. Any help would be appreciated.

Assuming you've some kind of date column (date, datetime, etc...) and it's named in my example date_time, just do the following:

$query = "
INSERT INTO tbl_test 
 (full_name, id_number, email, pin_rank, team_name, date_time) 
 VALUES (:full_name, :id_number, :email, :pin_rank, :team_name, NOW())
 "

Note, if you've got anything other than a date field, you'll get the time along this as well.

I'm not a big fan of the DB NOW because the DB uses it's own timezone settings separate from PHP.

So you can change the TimeZone in PHP and not in MySql and wind up with dates that are wrong (found that out the hard way one time).

And as that has been shown already, I'll show you how to do it with just PHP.

$query = "
INSERT INTO tbl_test 
(full_name, id_number, email, pin_rank, team_name, created) 
VALUES (:full_name, :id_number, :email, :pin_rank, :team_name, :created)
";

$today = (new DateTime)->format('Y-m-d H:i:s');
#$today = date('Y-m-d H:i:s'); //procedural

for($count = 0; $count<count($_POST['hidden_full_name']); $count++)
{
 $data = array(
     ':full_name' => $_POST['hidden_full_name'][$count],
     ':id_number' => $_POST['hidden_id_number'][$count],
     ':email'     => $_POST['hidden_email'][$count],
     ':pin_rank'  => $_POST['hidden_pin_rank'][$count],
     ':team_name' => $_POST['hidden_team_name'],
     ':created'   => $today 
 );
 $statement = $connect->prepare($query);
 $statement->execute($data);
}

You can of course get the date and time, within the loop if you need second precision but it's less efficient, due to multiple calls to DateTime.