Я получаю эти результаты массива:PHP Как заменить значение пространственного массива на другое значение массива?
Array
(
[0] => Array
(
[subscription_id] => 67
[user_id] => 156
[property_id] => 1036
[title] => Rotchild 50, Tel Aviv, Israel
[subscription_plan_id] => 13
[transactionID] => VHHDLY2P5CC7V5K34UA5SUFWVM
[transactionDisplayID] => 441486
[paid_with] => Visa
[active] => 1
[start_date] => 2015-02-11 09:22:08
[end_date] => 2015-03-12
[s_start_date] => 2015-02-12 09:29:33
[s_subscription_id] => 70
)
[1] => Array
(
[subscription_id] => 66
[user_id] => 156
[property_id] => 1036
[title] => Rotchild 50, Tel Aviv, Israel
[subscription_plan_id] => 2
[transactionID] => VHHDLY2P5CC7V5K34UA5SUFWVM
[transactionDisplayID] => 441486
[paid_with] => Visa
[active] => 1
[start_date] => 2015-02-11 09:22:07
[end_date] => 2015-03-12
[s_start_date] => 2015-02-12 09:26:50
[s_subscription_id] => 69
)
)
Теперь Как заменить end_date
ключевое значение start_date
значение ключа с приращением 1 день, как:
Array
(
[0] => Array
(
[subscription_id] => 67
[user_id] => 156
[property_id] => 1036
[title] => Rotchild 50, Tel Aviv, Israel
[subscription_plan_id] => 13
[transactionID] => VHHDLY2P5CC7V5K34UA5SUFWVM
[transactionDisplayID] => 441486
[paid_with] => Visa
[active] => 1
[start_date] => 2015-03-13
[end_date] => 2015-03-12
[s_start_date] => 2015-02-12 09:29:33
[s_subscription_id] => 70
)
[1] => Array
(
[subscription_id] => 66
[user_id] => 156
[property_id] => 1036
[title] => Rotchild 50, Tel Aviv, Israel
[subscription_plan_id] => 2
[transactionID] => VHHDLY2P5CC7V5K34UA5SUFWVM
[transactionDisplayID] => 441486
[paid_with] => Visa
[active] => 1
[start_date] => 2015-03-13
[end_date] => 2015-03-12
[s_start_date] => 2015-02-12 09:26:50
[s_subscription_id] => 69
)
)
Любая идея, как заменить spacific значение массива в другой?
Имеет ли этот массив запрос базы данных? Если это так (при условии, что MySQL), было бы проще запросить значение 'start_date' с помощью функции даты в формате MySQL, например' end_date + INTERVAL 1 DAY', чем после обработки даты на PHP. –