|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
General - Retrieve Weekend days
I like to use this code that i found on php.net/strtotime but no luck.
PHP Code:
Example: $startDate = '2006-08-28'; $endDate = '2006-10-09'; $days = 'M,W'; then getDaysBetween($startDate, $endDate, $days); returns Array ( [0] => 2006-08-28 [1] => 2006-09-04 [2] => 2006-09-11 [3] => 2006-09-18 [4] => 2006-09-25 [5] => 2006-10-02 [6] => 2006-10-09 [7] => 2006-08-28 [8] => 2006-08-30 [9] => 2006-09-06 [10] => 2006-09-13 [11] => 2006-09-20 [12] => 2006-09-27 [13] => 2006-10-04 ) |
|
#2
|
|||
|
|||
|
Well it looks to me that your error is one of two places.
In the original code from the site you mentioned the case statement is used to convert an abbreviated day to a the standard 3 character day. In the code you posted the case statement no longer does this and is, in fact redundant, from what I can tell. So you can try either returning to the original case statement or modify your original value for $days from 'M' to 'Mon' and see if that fixes it. |
|
#3
|
|||
|
|||
|
The funny thing is i tested this code on php4.2.3 and works fine.
On the php 5.2.4 did not work. I compared the conf from php4x but no luck, even bump the mem limit to 256mb did not help at all. No matter the size still with the same error. The error on the php5 is: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 79 bytes) in /var/www/codex/func.php on line 47 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > General - Retrieve Weekend days |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|