A query returns objects, which I then want to loop through to create HTML content. I have a problem converting / using MongoDB BSON Date items…
I have tried:
<input type="hidden" id="roundDate" name="roundDate" value="<?php echo $round['roundDate']->toString(); ?>">
I can display the same field on the page (literally the line above in my PHP source code):
<?php echo $round['roundDate']->format("d M Y"); ?>
Essentially, I am using this structure to pass it through to the next page with an HTML form, via
$_POST, which is then stored in
$_SESSION for any further access / use.
Hope someone can correct my ways or spot the error!