I have a php var that var_dump
's this which is coming from a for loop query to the database.
string(19) "2021-09-14 15:23:27" string(19) "2021-09-17 09:59:28" string(19) "2021-09-23 10:29:33" string(19) "2021-09-24 16:07:50"
I first tried to convert them all to a single array with no luck. when I covert it to an array using explode
I get this which is multiple arrays.
array(1) {
[0]=> string(19) "2021-09-14 15:23:27" }
array(1) {
[0]=> string(19) "2021-09-17 09:59:28" }
array(1) {
[0]=> string(19) "2021-09-23 10:29:33" }
array(1) {
[0]=> string(19) "2021-09-24 16:07:50" }
Ultimately what I need to do is get the strings values separately for different calculations.
for example: I would like to get the first string "2021-09-14 15:23:27" and use it for calculating time passed against another string such as "2021-09-24 16:07:50".
I know I'm missing something and it's probably very simple what is it?
source https://stackoverflow.com/questions/69396501/need-to-define-this-array-and-figure-out-how-to-get-first-value-php
Comments
Post a Comment