[PHP] Need help on increment date

2012-05-24 Thread Md Ashickur Rahman Noor
HI all I need help to increment date in php. I found this code helpful $date = strtotime(+1 day, strtotime(2007-02-28)); echo date(Y-m-d, $date); But when My date is 2008-02-28 this code give output 2012-03-01. But it should be 2008-02-29. Where I am getting wrong.

Re: [PHP] Need help on increment date

2012-05-24 Thread Stuart Dallas
On 24 May 2012, at 08:18, Md Ashickur Rahman Noor wrote: I need help to increment date in php. I found this code helpful $date = strtotime(+1 day, strtotime(2007-02-28)); echo date(Y-m-d, $date); But when My date is 2008-02-28 this code give output 2012-03-01. But it should be

Re: [PHP] Need help on increment date

2012-05-24 Thread Md Ashickur Rahman Noor
Get this from herehttp://stackoverflow.com/questions/660501/simplest-way-to-increment-a-date-in-php -- Dedicated Linux Forum in Bangladesh http://goo.gl/238Ck 2048R/89C932E1 http://goo.gl/TkP5U Volunteer, FOSS Bangladesh http://fossbd.org/

Re: [PHP] Need help on increment date

2012-05-24 Thread shiplu
It works for me too. I tell you two things, a) make sure there is a space after +1 day. So it should look like +1 day . This ensures that the unix time is not concatenated with day. b) calling strtotime 2 times is not a great solution. You can all it once only. Like this, $date = strtotime

Re: [PHP] Need help on increment date

2012-05-24 Thread Md Ashickur Rahman Noor
It works. Thanks you two. Thanks Shiplu bro for the advice. -- Dedicated Linux Forum in Bangladesh http://goo.gl/238Ck 2048R/89C932E1 http://goo.gl/TkP5U Volunteer, FOSS Bangladesh http://fossbd.org/ Mozilla Repshttp://reps.mozilla.org

[PHP] Cookie use management

2012-05-24 Thread Lester Caine
Not directly a PHP problem, but since PHP tends to automatically create a session cookie I thought it appropriate to ask here first. The European rules on asking permission to use cookies have been around for a year now, and very few sites seem to be worrying about it until now, but press

Re: [PHP] Cookie use management

2012-05-24 Thread Jeremiah Dodds
Lester Caine les...@lsces.co.uk writes: Not directly a PHP problem, but since PHP tends to automatically create a session cookie I thought it appropriate to ask here first. I don't know about the rest of your post, but you can easily turn off this behavior if it's present (unless you are using

Re: [PHP] w.r.t. mail() function

2012-05-24 Thread Matijn Woudt
On Wed, May 23, 2012 at 10:25 PM, Jim Lucas li...@cmsws.com wrote: On 05/22/2012 09:12 PM, Ashwani Kesharwani wrote: Hi , I have a query w.r.t. mail() function in php. I have hosted my site and i have created an email account as well. when i am sending mail to different recipient from my

Re: [PHP] Function size

2012-05-24 Thread Matijn Woudt
On Wed, May 23, 2012 at 10:14 PM, shiplu shiplu@gmail.com wrote: On Thu, May 24, 2012 at 1:56 AM, Matijn Woudt tijn...@gmail.com wrote: I agree that large switch block are not always easy and useful to split, however, writing too much code inside a switch block isn't considered good

[PHP] problem sending email

2012-05-24 Thread As'ad Djamalilleil
hi all,i'm having this problem in sending email using pear. it just wont send :( here's the code .. ?php require_once 'Mail.php'; $from_name = My Self; $to_name = My Friend; $subject = Sending Trial; $mailmsg = GOD please make it work; $From = From: .$from_name.

Re: [PHP] problem sending email

2012-05-24 Thread Matijn Woudt
On Thu, May 24, 2012 at 2:00 PM, As'ad Djamalilleil asad@gmail.com wrote: hi all,i'm having this problem in sending email using pear. it just wont send :( here's the code .. ?php    require_once 'Mail.php';    $from_name = My Self;    $to_name = My Friend;    $subject = Sending

RE: [PHP] Function size

2012-05-24 Thread Steven Staples
My monitor can also display about 55 lines of code, my functions are, on average, just a few lines of code though -- a maximum of about 20, with an average of around 5 or so. This is because the rule of thumb I follow is that a function should do one thing, and should be named well. The

Re: [PHP] Cookie use management

2012-05-24 Thread Lester Caine
( Forgot email address :) ) Jeremiah Dodds wrote: Lester Caineles...@lsces.co.uk writes: Not directly a PHP problem, but since PHP tends to automatically create a session cookie I thought it appropriate to ask here first. I don't know about the rest of your post, but you can easily turn off

Re: [PHP] openssl_sign() openssl_verify() discrepancy

2012-05-24 Thread jas
On 05/23/2012 02:00 PM, Matijn Woudt wrote: On Wed, May 23, 2012 at 9:42 PM, Jason Gerfenjason.ger...@utah.edu wrote: On 05/23/2012 01:26 PM, Matijn Woudt wrote: On Wed, May 23, 2012 at 9:12 PM, Jason Gerfenjason.ger...@utah.edu wrote: On 05/23/2012 01:05 PM, Matijn Woudt wrote: On

Re: [PHP] Function size

2012-05-24 Thread Jeremiah Dodds
Steven Staples sstap...@mnsi.net writes: My monitor can also display about 55 lines of code, my functions are, on average, just a few lines of code though -- a maximum of about 20, with an average of around 5 or so. This is because the rule of thumb I follow is that a function should do

Re: [PHP] Function size

2012-05-24 Thread Tedd Sperling
On May 23, 2012, at 3:49 PM, Ashley Sheridan wrote: I'm of the same mind. Generally I'll split a function if I'm reusing more than a couple of lines of code. I only split a large function if it's actually doing several things, if it happens to need 200 lines to perform one 'step' then

Re: [PHP] Function size

2012-05-24 Thread Tedd Sperling
On May 24, 2012, at 8:37 AM, Steven Staples wrote: Tedd, I think the length of code depends on a few different factors, what if you have your docblocks, and comment lines, as well as your bracing style? Where do you consider your function to start? It starts where it starts. It doesn't make

Re: [PHP] w.r.t. mail() function

2012-05-24 Thread Jim Lucas
On 05/24/2012 04:39 AM, Matijn Woudt wrote: On Wed, May 23, 2012 at 10:25 PM, Jim Lucasli...@cmsws.com wrote: On 05/22/2012 09:12 PM, Ashwani Kesharwani wrote: Hi , I have a query w.r.t. mail() function in php. I have hosted my site and i have created an email account as well. when i am

[PHP] Re: Function size

2012-05-24 Thread tamouse mailing lists
On May 23, 2012 9:14 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50 lines per function, most much less. Back in the day when we didn't have nifty gui screens and an 24 line terminals (yay

Re: [PHP] Re: Function size

2012-05-24 Thread Ashley Sheridan
On Thu, 2012-05-24 at 15:48 -0500, tamouse mailing lists wrote: On May 23, 2012 9:14 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: A rule of thumb is no more than 50 lines per function, most much less. Back in the day