PHP Snippet always appears on top of page
-
Greetings,
I’ve inserted the following PHP code in a snippet:
$StartDate = strtotime(‘2016-05-10’); //Start date from which we begin count
$CurDate = date(“Y-m-d”); //Current date.
$NextDate = date(“Y-m-d”, strtotime(“+2 week”, $StartDate)); //Next date = +2 week from start date
while ($CurDate > $NextDate ) {
$NextDate = date(“Y-m-d”, strtotime(“+2 week”, strtotime($NextDate)));
}
echo date(“Y-m-d”, strtotime($NextDate)), “\n”;I’ve inserted the correspondent shortcode in the HTML editor of a page and the code is executed. The problem is that the result always appears on the top of the page (instead of the place where the shortcode is placed).
How can I solve this situation and get the PHP code result in the proper place?
Thanks in advance.
The topic ‘PHP Snippet always appears on top of page’ is closed to new replies.