A php student here that has been stuck for many hours now :(
Here's my problem, this:
echo"<pre>";print_r($array1);echo"</pre>";
prints:
Array
(
[0] => stdClass Object
(
[id] => 4d6f6aec35993704d52c0d9d
[createdAt] => 1299147500
[place] => stdClass Object
(
[id] => 4adcda40f964a5208a3e21e3
)
)
[1] => stdClass Object
(
[id] => 654jk654n646g54j6kl54j645
[createdAt] => 1299147500
[place] => stdClass Object
(
[id] => 4gh543gh5h5g354h3gg53gh
)
)
.
.
.
createdAt is the timestamp of the date the place was created. I need the place id of the places created in between timestamps.
Here's my approach on the in between timestamps logic:
$array2 = array();
$begin = strtotime("2011-02-17 12:22:49");
$end = strtotime("2011-03-03 10:00:00");
foreach($array1 as $timestamp){
if($timestamp <= $end && $timestamp >= $begin){
$array2[] = $timestamp;
}
}
It is correct to me, but as I said the info I need in $array2 is the place ids created in between these timestamps.
How can I do that?
Thanks a ton!