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" 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

[PHP] Re: Function size

2012-05-24 Thread tamouse mailing lists
On May 23, 2012 9:14 AM, "Tedd Sperling" 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 green o

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 Lucas 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 d

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

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' t

Re: [PHP] Function size

2012-05-24 Thread Jeremiah Dodds
"Steven Staples" 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 > one >>

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 Gerfen wrote: On 05/23/2012 01:26 PM, Matijn Woudt wrote: On Wed, May 23, 2012 at 9:12 PM, Jason Gerfen wrote: On 05/23/2012 01:05 PM, Matijn Woudt wrote: On Wed, May 23, 2012 at 8:29 PM, jas wrote:

Re: [PHP] Cookie use management

2012-05-24 Thread Lester Caine
( Forgot email address :) ) Jeremiah Dodds wrote: Lester Caine 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 i

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. Th

Re: [PHP] problem sending email

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

[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 .. "; $To = "To: ".$to_name." "; $recipients = "some...@yahoo.com"; $headers["From"] = $From; $headers["To"] = $To; $headers["Subject"] = $subject; $headers["Content-Type"] = "

Re: [PHP] Function size

2012-05-24 Thread Matijn Woudt
On Wed, May 23, 2012 at 10:14 PM, shiplu wrote: > > > On Thu, May 24, 2012 at 1:56 AM, Matijn Woudt 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 >> practice too IMO. Though, it i

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

2012-05-24 Thread Matijn Woudt
On Wed, May 23, 2012 at 10:25 PM, Jim Lucas 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] Cookie use management

2012-05-24 Thread Jeremiah Dodds
Lester Caine 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 a rather poor ho

[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 cove

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 2048R/89C932E1 Volunteer, FOSS Bangladesh && Mozilla Reps

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 = strtoti

Re: [PHP] Need help on increment date

2012-05-24 Thread Md Ashickur Rahman Noor
Get this from here -- Dedicated Linux Forum in Bangladesh 2048R/89C932E1 Volunteer, FOSS Bangladesh

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 >

[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.