PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Before that loop there are 5 values set - $day, $month, $year, $timestamp (timestamp of the first day of the month) and $tableWeek=0 (it indicates current table cell's position, to know what day to put on that cell or to skip that cell.
The problem is, that the browser crashes when specific month is chosen. For example, it displays 2007 year 9 and 11th months perfectly, but on 10th month the browser crashes and I can't fins the problem which causes that. I think the "for" loop somehow becomes infinitive on that month, but I can't find where. When another month is reached, it should break the loop.
Maybe it's valid.. I've just never seen it that way.
EDIT| I guess it is valid. But it does cause infinite loops since it evaluates to TRUE.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
This code should break the loop if another month value is reached. It should reach another value after about 31 loops, because $timestamp is increased by 1 day every cycle, so it should reach another month, which should evaluate TRUE to the above expression and break the loop. But it doesn't break the loop every time. That's the problem.
EDIT: Are talking about for(;; ) part? Well, sometimes it's useful to give no conditions to the loop, and break the loop when you choose to, especially when there are several possibilities to end the loop. I learned that somewhere, but now I don't remember if it was C++ tutorial or PHP
This code should break the loop if another month value is reached. It should reach another value after about 31 loops, because $timestamp is increased by 1 day every cycle, so it should reach another month, which should evaluate TRUE to the above expression and break the loop. But it doesn't break the loop every time. That's the problem.
EDIT: Are talking about for(;; ) part? Well, sometimes it's useful to give no conditions to the loop, and break the loop when you choose to, especially when there are several possibilities to end the loop. I learned that somewhere, but now I don't remember if it was C++ tutorial or PHP
So... I've changed "for" loop into "do... while" loop and it worked great! Still I can't understand what was so different and why didn't my old loop work... But anyway, it worked, that's most important.