On 12-05-29 07:17 AM, Stuart Dallas wrote:
>
I wasn't going to respond to this thread because I think it's a largely
> ridiculous topic, but some of the responses have scared me. Sir Cummings
> (hopefully) sarcastic response about using a 5px font size demonstrated
> how daft it is to base funct
On Tue, May 29, 2012 at 11:56:47AM -0400, Tedd Sperling wrote:
> On May 29, 2012, at 10:20 AM, Stuart Dallas wrote:
>
> > -snip- Besides, truth is subjective, but then so is everything,
> > including that assertion.
> >
> > -Stuart
>
> You reply was longer than my monitor was high so I can't gi
On May 29, 2012, at 5:06 PM, Paul M Foster wrote:
>
> I think a lot of coders try to be kewler than the next 18 guys who are
> gonna have to look at the code, so they use a lot of "compression"
> techniques to reduce LOC.
That's not kewl to me.
> Plus, they're lazy. I'd rather see everything
> w
> The art of software development is in taking a problem, breaking it up in to
> bite-size chunks, and putting those chunks together to form a practical
> solution. Anyone who considers themselves a "better" programmer because their
> functions are large due to their ability to handle large func
On May 29, 2012, at 10:20 AM, Stuart Dallas wrote:
> -snip-
> Besides, truth is subjective, but then so is everything, including that
> assertion.
>
> -Stuart
You reply was longer than my monitor was high so I can't give an immediate
reply -- I have to scroll. :-)
However, with that said, you
On 29 May 2012, at 14:38, Tedd Sperling wrote:
> On May 29, 2012, at 7:17 AM, Stuart Dallas wrote:
>>
>> It's a theory, yes, and for many people it may be valid, but it's not for
>> me. The resolution of your screen; the size of your font; the colour scheme
>> you use. These should not be a fac
On 23 May 2012, at 15:14, 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 on blac
On May 24, 2012, at 5:01 PM, Ashley Sheridan wrote:
> On Thu, 2012-05-24 at 15:48 -0500, tamouse mailing lists wrote:
>> On May 23, 2012 9:14 AM, "Tedd Sperling" > > wrote:
>> >
>> > H
>> Yes, I think that is *exactly* the criterion-- not a mystery or an emergent
>> thing, really, was a pretty exp
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
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
"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
>>
> 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
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
Tedd Sperling writes:
> It would be an interesting survey to ask programmers to review their code and
> provide the average number of lines in their functions AND how many lines of
> code their monitor's can display. In other words, look at your editor; count
> the
> number of lines your monitor
I use a lot of switches but they are always small in size because they look
mostly like this:
switch($action) {
case 'hello':
$someObject->executeAction();
break;
case 'world':
$someOtherObject->executeOtherAction();
break;
default:
$this->anotherAction();
break;
}
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 is unavoidable in some cases I think. I do
> have some of the
On Wed, May 23, 2012 at 9:49 PM, Ashley Sheridan
wrote:
> **
> On Wed, 2012-05-23 at 20:59 +0200, Matijn Woudt wrote:
>
> On Wed, May 23, 2012 at 5:49 PM, shiplu wrote:
> > On Wed, May 23, 2012 at 8:14 PM, Tedd Sperling wrote:
> >
> >> Hi gang:
> >>
> >> On May 21, 2012, at 8:32 PM, tamouse mail
On Wed, 2012-05-23 at 20:59 +0200, Matijn Woudt wrote:
> On Wed, May 23, 2012 at 5:49 PM, shiplu wrote:
> > On Wed, May 23, 2012 at 8:14 PM, 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
On May 23, 2012, at 12:21 PM, Robert Cummings wrote:
> On 12-05-23 12:15 PM, Tedd Sperling wrote:
>> What I was talking about was that what we can grasp in one view, we can
>> understand better. If the code lies outside of our view, then we understand
>> it less. I can support this claim with num
On Wed, May 23, 2012 at 5:49 PM, shiplu wrote:
> On Wed, May 23, 2012 at 8:14 PM, 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 hav
On 12-05-23 12:15 PM, Tedd Sperling wrote:
On May 23, 2012, at 11:49 AM, shiplu wrote:
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
When number of lines becomes the criteria of function size? Wouldn't it depends
on the task the function is doing?
You missed the point.
Of course
On May 23, 2012, at 11:49 AM, shiplu wrote:
> On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
> When number of lines becomes the criteria of function size? Wouldn't it
> depends on the task the function is doing?
You missed the point.
Of course, the difficulty of the task of a specif
On Wed, May 23, 2012 at 8:14 PM, 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 gr
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 on black!), if a
> function exceeded one printed page, it was d
On Thu, May 3, 2012 at 9:12 PM, Ron Piggott
wrote:
> I need to access a FUNCTION I programmed within a different FUNCTION. Are
> these able to be passed like a variable? Or are they able to become like a
> $_SESSION variable in nature? How am I able to do this?
>
> I am essentially programmin
On Fri, May 4, 2012 at 9:18 PM, Jim Giner wrote:
> But the OP says "function is defined inside a different function". Your
> theories to a solution don't fit that problem.
[snip]
> But the OP says "function is defined inside a different function". Your
> theories to a solution don't fit that pro
But the OP says "function is defined inside a different function". Your
theories to a solution don't fit that problem.
"tamouse mailing lists" wrote in message
news:cahuc_t-416_-lpcn3mo8qqxwrh4pnq5fmwouhwpdk+hmkgh...@mail.gmail.com...
On Thu, May 3, 2012 at 9:12 PM, Ron Piggott
wrote:
Where i
On Thu, May 3, 2012 at 9:12 PM, Ron Piggott
wrote:
> I need to access a FUNCTION I programmed within a different FUNCTION. Are
> these able to be passed like a variable? Or are they able to become like a
> $_SESSION variable in nature? How am I able to do this?
>
> I am essentially programmin
On Fri, May 4, 2012 at 4:29 AM, Dan Joseph wrote:
>
> Are these inside classes or anything? If they're just functions, they
> should work fine together, example of 2 working functions together:
>
>
> hellotwo();
>
> function helloone()
> {
> echo "hi 1";
> }
>
> function hellotwo()
> {
>
On Thu, May 3, 2012 at 10:12 PM, Ron Piggott wrote:
> I need to access a FUNCTION I programmed within a different FUNCTION. Are
> these able to be passed like a variable? Or are they able to become like a
> $_SESSION variable in nature? How am I able to do this?
>
> I am essentially programmin
I need to access a FUNCTION I programmed within a different FUNCTION. Are
these able to be passed like a variable? Or are they able to become like a
$_SESSION variable in nature? How am I able to do this?
I am essentially programming:
===
function name( $flag1, $flag2 ) {
# some PHP
echo
On Mon, 2012-03-12 at 15:53 -0400, Tedd Sperling wrote:
> On Mar 11, 2012, at 3:10 PM, Matijn Woudt wrote:
> > On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling
> > wrote:
> >> Actually, this works for me:
> >>
> >> $days_in_month = date('t', mktime(0, 0, 0, $next_month, 0, $year));
> >>
> >> But
On Mar 11, 2012, at 3:10 PM, Matijn Woudt wrote:
> On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling
> wrote:
>> Actually, this works for me:
>>
>> $days_in_month = date('t', mktime(0, 0, 0, $next_month, 0, $year));
>>
>> But again, I don't see why I have to use "next month" to find the number of
On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling wrote:
> On Mar 11, 2012, at 6:12 AM, Ashley Sheridan wrote:
>>
>> I still don't see what's wrong with
>>
>> date("t");
>>
>> --
>> Thanks,
>> Ash
>
> Ash:
>
> It's just too damn simple -- we need to make things complicated. :-)
>
> Actually, this wor
On Mar 11, 2012, at 6:12 AM, Ashley Sheridan wrote:
>
> I still don't see what's wrong with
>
> date("t");
>
> --
> Thanks,
> Ash
Ash:
It's just too damn simple -- we need to make things complicated. :-)
Actually, this works for me:
$days_in_month = date('t', mktime(0, 0, 0, $next_month, 0,
On Sat, 2012-03-10 at 20:38 -0500, Tedd Sperling wrote:
> On Mar 10, 2012, at 12:20 PM, Maciek Sokolewicz wrote:
>
> > function getAmountOfDaysInAMonth($month, $year) {
> > $days = array(31, (($year%4==0 and ($year%100 > 0 or $year%400==0)) ? 29
> > : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 3
On Mar 10, 2012, at 12:20 PM, Maciek Sokolewicz wrote:
> function getAmountOfDaysInAMonth($month, $year) {
> $days = array(31, (($year%4==0 and ($year%100 > 0 or $year%400==0)) ? 29 :
> 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
> return $days[$month+1];
> }
I like that -- here's a small
On Sat, Mar 10, 2012 at 9:47 PM, tamouse mailing lists
wrote:
> I'm just a bit baffled why this isn't a standard library function.
Good question, but I think the problem here is that there are tons of
these small functions, and you got to make a choice on what to
implement and what not. I can thi
I'm just a bit baffled why this isn't a standard library function.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 10 March 2012 19:06, Matijn Woudt wrote:
> On Sat, Mar 10, 2012 at 6:20 PM, Maciek Sokolewicz
> wrote:
> > On 09-03-2012 14:11, Daniel Brown wrote:
> >>
> >> (To the list, as well. First day with my new fingers,
> apparently)
> >>
> >> On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrot
On Sat, Mar 10, 2012 at 6:20 PM, Maciek Sokolewicz
wrote:
> On 09-03-2012 14:11, Daniel Brown wrote:
>>
>> (To the list, as well. First day with my new fingers, apparently)
>>
>> On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrote:
>>>
>>> On Thu, Mar 8, 2012 at 21:23, Tedd Sperling
>>> wr
On 09-03-2012 14:11, Daniel Brown wrote:
(To the list, as well. First day with my new fingers, apparently)
On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrote:
On Thu, Mar 8, 2012 at 21:23, Tedd Sperling wrote:
This starts getting a bit off-topic from your original email, but
know
AIK there is no
> such function in PHP to get the number of days
> without accessing the last second in the month. Besides, showing how
> it is done is part of education.
Arrggg.
When I said "I, I meant "I" and not a php function.
Sometimes the point is never made.
ted
On Sat, Mar 10, 2012 at 12:57 AM, Charles wrote:
> On Sat, Mar 10, 2012 at 12:52 AM, Charles wrote:
>> On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
>> wrote:
>>> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>>>
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
wrote:
> On Mar 9,
Charles wrote:
>On Sat, Mar 10, 2012 at 12:52 AM, Charles wrote:
>> On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
> wrote:
>>> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>>>
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
> wrote:
> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
On Sat, Mar 10, 2012 at 12:52 AM, Charles wrote:
> On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
> wrote:
>> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>>
>>> On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
>>> wrote:
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
>> From: Tedd Sperl
And again to the list, since for some reason "Reply-to-all" did not do
as intended this time.
-- Forwarded message --
From: Andrew Ballard
Date: Fri, Mar 9, 2012 at 12:53 PM
Subject: Re: [PHP] Function mktime() documentation question
To: Tedd Sperling
On Fri, Mar
On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling wrote:
> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>
>> On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
>> wrote:
>>> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
> But why does anyon
On Mar 9, 2012, at 11:17 AM, Charles wrote:
> On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
> wrote:
>> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
But why does anyone have to use the next month to figure out how
many days th
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling wrote:
> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
>>> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
>>> But why does anyone have to use the next month to figure out how
>>> many days there are are in this month? Do you see my point?
>>
>>
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
>> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
>> But why does anyone have to use the next month to figure out how
>> many days there are are in this month? Do you see my point?
>
> Actually, no. To figure this out, somewhere along the line yo
(To the list, as well. First day with my new fingers, apparently)
On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrote:
> On Thu, Mar 8, 2012 at 21:23, Tedd Sperling wrote:
>
> This starts getting a bit off-topic from your original email, but
> knowing that you're trying to use it for te
Ford, Mike wrote:
Side-point: I find it interesting that getdate() has all sorts of
> neat descriptions for the current month (such as, what weekday a
> numbered day is), but lacks how many days are in the month. Doesn't
> that seem odd?
Now that's a decent point: I can see where you're comin
> -Original Message-
> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
> Sent: 08 March 2012 23:15
> To: PHP-General List
[previous discussion snipped]
> Mike:
>
> Very well put.
>
> You say:
>
> > Huh? The 0th day of next month *is* the last day of the current
> month,
> > whi
On Fri, Mar 9, 2012 at 9:23 AM, Tedd Sperling wrote:
> On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
> On Mar 8, 2012 6:14 PM, "Tedd Sperling" wrote:
>>
>> > Side-point: I find it interesting that getdate() has all sorts of neat
>> > descriptions for the current month (such as, what weekday a
On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
On Mar 8, 2012 6:14 PM, "Tedd Sperling" wrote:
>
> > Side-point: I find it interesting that getdate() has all sorts of neat
> > descriptions for the current month (such as, what weekday a numbered day
> > is), but lacks how many days are in the mo
On 03/08/2012 04:44 PM, Jim Lucas wrote:
On 03/08/2012 04:31 PM, Jim Lucas wrote:
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com
On 03/08/2012 04:31 PM, Jim Lucas wrote:
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a mo
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first i
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first index of the next month -- not the last da
On Mar 8, 2012 6:14 PM, "Tedd Sperling" wrote:
>
> On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
> >> -Original Message-
> >> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
> >> From my code, the number of days in a month can be found by using 0
> >> as the first index of the next m
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
>> -Original Message-
>> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
>> From my code, the number of days in a month can be found by using 0
>> as the first index of the next month -- not the last day of the
>> previous month.
>
> Huh?
On Mar 7, 2012, at 4:28 PM, Daniel Brown wrote:
> On Wed, Mar 7, 2012 at 15:03, Tedd Sperling wrote:
>> Hi gang:
>>
>> I am using the getdate(mktime()) functions to get month data (i.e., name of
>> month, first weekday, last day, number of days).
>>
>> To get the number of days for a specific
On Thu, Mar 8, 2012 at 7:01 AM, Simon Schick
wrote:
> $date = new DateTime($year . '-' . $current_month . '-1');
> $date->add( new DateInterval( 'P1M' ) ); // Add a period of 1 month to
> the date-instance (haven't tried that with the 30th of Jan ... would
> be kind-of interesting)
>
> $days_in_cu
Hi, All
To bring a work-around into this discussion I myself would not see it
as a good way to do it like that - even if the documentation provides
some information around that.
Here's what I have done in all new projects I worked with time-calculation:
@Tedd: Lets pick up your first example and
> To get the number of days for a specific month, I use:
>
> // $current_month is the month under question
>
> $next_month = $current_month + 1;
I use this
$next_month = $current_month + 1;
$next_month_1= mktime(0, 0, 0, $next_month, 1, date("Y") );
$current_month_1= mktime(0, 0, 0, $curr
On Wed, Mar 7, 2012 at 15:03, Tedd Sperling wrote:
> Hi gang:
>
> I am using the getdate(mktime()) functions to get month data (i.e., name of
> month, first weekday, last day, number of days).
>
> To get the number of days for a specific month, I use:
>
> // $current_month is the month under ques
m-d 00:00:00',mktime(0,0,0,date('m')+1,1,date('Y')));
To get the days of any given month or just about anything you need to just
use the strtotime
$days_in_month = date('j',strtotime($this_month));
-Original Message-
From: Tedd Sperling [mailto:
Hi gang:
I am using the getdate(mktime()) functions to get month data (i.e., name of
month, first weekday, last day, number of days).
To get the number of days for a specific month, I use:
// $current_month is the month under question
$next_month = $current_month + 1;
$what_date = getda
On Fri, Feb 3, 2012 at 4:35 PM, Ford, Mike wrote:
>> -Original Message-
>> From: Florian Müller [mailto:florip...@hotmail.com]
>> Sent: 03 February 2012 14:36
>>
>> Hi guys,
>>
>> I was wondering some time ago, why the links which are shown on
>> error or warning (E_WARNING etc.) show rela
> -Original Message-
> From: Florian Müller [mailto:florip...@hotmail.com]
> Sent: 03 February 2012 14:36
>
> Hi guys,
>
> I was wondering some time ago, why the links which are shown on
> error or warning (E_WARNING etc.) show relative links to an usually
> non-existing file.
Because yo
Hi guys,
I was wondering some time ago, why the links which are shown on error or
warning (E_WARNING etc.) show relative links to an usually non-existing file.
Wouldn't it be much more useful if all errors are linking to the function
description on php.net?
So, if I get an error with file_ex
On 19 July 2010 10:04, Nilesh Govindarajan wrote:
> On Mon, Jul 19, 2010 at 2:22 PM, Shelley wrote:
>> Hi all,
>>
>> The problem is imagettfbbox().
>> jpgraph uses it to create truetype font images.
>>
>> I have a phpinfo() script.
>>
>> The command line output:
>>
>> php i.php | grep Free
>> Fre
On Mon, Jul 19, 2010 at 2:22 PM, Shelley wrote:
> Hi all,
>
> The problem is imagettfbbox().
> jpgraph uses it to create truetype font images.
>
> I have a phpinfo() script.
>
> The command line output:
>
> php i.php | grep Free
> FreeType Support => enabled
> FreeType Linkage => with freetype
> F
Hi all,
The problem is imagettfbbox().
jpgraph uses it to create truetype font images.
I have a phpinfo() script.
The command line output:
php i.php | grep Free
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.2.1
But when the script is loaded in the browser,
On 21 June 2010 00:45, Rick Pasotto wrote:
> Within a class function I have defined another function for use with the
> usort() function. How do I reference it?
>
> When it's not part of a class usort($arr,"cmp") works fine but when it's
> within a class function I get this error:
>
> PHP Parse er
On Sun, Jun 20, 2010 at 08:47:53PM -0400, Brandon Rampersad wrote:
> $this->usort();
> self::usort();
>
> On Sun, Jun 20, 2010 at 7:45 PM, Rick Pasotto wrote:
>
> > Within a class function I have defined another function for use with the
> > usort() function. How do I reference it?
> >
> > When
Within a class function I have defined another function for use with the
usort() function. How do I reference it?
When it's not part of a class usort($arr,"cmp") works fine but when it's
within a class function I get this error:
PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUN
Per Jessen wrote:
> AFAICT, gethostbyname() only works for ipv4 addresses, so that one is
> out - dns_get_record seems to be really for dns only, i.e. it does not
> look at /etc/hosts. Is there a hph function that essentially just
> calls getaddrinfo() ?
>
Wow, lots of answers to that one.
Le
AFAICT, gethostbyname() only works for ipv4 addresses, so that one is
out - dns_get_record seems to be really for dns only, i.e. it does not
look at /etc/hosts. Is there a hph function that essentially just
calls getaddrinfo() ?
--
Per Jessen, Zürich (19.1°C)
--
PHP General Mailing List (htt
At 4:51 AM +0200 5/13/10, Michelle Konzack wrote:
Hello,
while reading RFC3490 (plus 3454/3491/3492) and before I am ongoing to
reinvent the wheel here the question:
Does someone HAVE or know a function/class which
does the IDN conversion "toASCII" and "toUNICODE"?
Note: The C Sour
Hello,
while reading RFC3490 (plus 3454/3491/3492) and before I am ongoing to
reinvent the wheel here the question:
Does someone HAVE or know a function/class which
does the IDN conversion "toASCII" and "toUNICODE"?
Note: The C Source-Code is included in RFC3492 and
can more
On Nov 25, 2009, at 4:32 AM, Ashley Sheridan wrote:
> On Tue, 2009-11-24 at 23:27 -0800, Allen McCabe wrote:
>
>> If I were to loop through my inputs, I could just exclude any
>> problematic names, eg.:
>>
>> foreach ($_POST as $var = $val)
>> {
>> if ($var != filter.x || $var != filter.y)
>>
On Tue, 2009-11-24 at 23:27 -0800, Allen McCabe wrote:
> If I were to loop through my inputs, I could just exclude any
> problematic names, eg.:
>
> foreach ($_POST as $var = $val)
> {
>if ($var != filter.x || $var != filter.y)
> {
> $var = $val;
> }
> }
>
> Like that?
>
>
> On Tue
On Tue, 2009-11-24 at 02:11 -0800, Allen McCabe wrote:
> I am! Will these extra query variables cause any problems or should I
> use standard submit inputs?
>
> Thanks Ashley!
>
>
> On Tue, Nov 24, 2009 at 1:10 AM, Ashley Sheridan
> wrote:
>
>
> On Mon, 2009-11-23 at 21:53 -0
On Mon, 2009-11-23 at 21:53 -0800, Allen McCabe wrote:
> Okay, suddenly I got it to filter the results, but I still can't figure out
> where this part of the query is coming from, at the end of the query string
> in the URL, I have this "filter.x=0&filter.y=0".
>
> No where in my form do I have a
Okay, suddenly I got it to filter the results, but I still can't figure out
where this part of the query is coming from, at the end of the query string
in the URL, I have this "filter.x=0&filter.y=0".
No where in my form do I have a field named filter.x or filter.y. I DO
however, have 3 forms (I d
On Nov 23, 2009, at 6:22 PM, Allen McCabe wrote:
> Hi, thanks for reading, I hope you can help:
>
> In my main file for an orders page I have the following code:
>
>
> if (isset($_GET['filterby']))
> {
> $resultOrders = adminFilterQuery();
> $numberOfOrders = mysql_num_rows($resultOrders);
>
Likely your query failed due to an error.
Try adding an or die(mysql_error()) to the end of your mysql_query
statement to see what that error maybe
Bastien
Sent from my iPod
On Nov 23, 2009, at 7:22 PM, Allen McCabe wrote:
Hi, thanks for reading, I hope you can help:
In my main file for
Hi, thanks for reading, I hope you can help:
In my main file for an orders page I have the following code:
if (isset($_GET['filterby']))
{
$resultOrders = adminFilterQuery();
$numberOfOrders = mysql_num_rows($resultOrders);
}
else
{
$resultOrders = mysql_query("SELECT * FROM afy_order;
Hello,
I am trying to get this function working but it gives me a PHP error
(blank page):
function Validate_Page_Nav($LastPage, $ErrorPage) {
$trimmed = str_replace($staffroot, '', $_SERVER['SCRIPT_NAME']);
$resul = $db->query("SELECT * FROM Page_Access WHERE URI =
'$trimmed'") or die("fai
Hi,
I've sent this mail a few days ago, but as this list have a very high
traffic maybe my mail disappear from you inbox.
Any help would be appreciated.
Thanks in advance,
Gabriel.
On Sun, Oct 11, 2009 at 4:42 PM, Gabriel Hahmann
wrote:
> Hi,
>
> I'm new to the list and I've search internet an
Hi,
I'm new to the list and I've search internet and didn't find an answer
to my problem.
I'm converting a perl script to PHP and I've done almost everything.
The only part of the code that I didn't get working on PHP was:
(PERL CODE)
foreach ($b_length,$b_mac,$b_crlf,$b_crlf,$a_body) {
2009/7/6 Lupus Michaelis :
>
> David Otton a écrit :
>
>> So there's some serious impedance mismatch going on there to make both
>> features to work together. Just think of the default value as
>> "something I can overwrite", eg:
>
> Thanks for this smart explanation. It shines my day.
np. On ref
David Otton a écrit :
So there's some serious impedance mismatch going on there to make both
features to work together. Just think of the default value as
"something I can overwrite", eg:
Thanks for this smart explanation. It shines my day.
--
Mickaël Wolff aka Lupus Michaelis
http://lupusm
2009/7/6 Lupus Michaelis :
> I'm happy PHP raises an error on foo(null) ;
> I'm in trouble when foo() doesn't.
>
> The actual question is : why PHP doesn't raise an error ?
This functionality (default values for passed-by-reference parameters)
was added in PHP5.
The problem is that you can't
Stuart a écrit :
The whole point of default arguments is for it to use that argument if
none is passed.
It is not the point too.
What makes you think not passing an argument to that function should
raise an error?
Maybe because in my example, the provided value is not a valuable
value fo
2009/7/6 Lupus Michaelis :
> Stuart a écrit :
>
>> You appear to be using the definition of null that comes from the
>> world of C.
>
> I didn't. The point is I'm allowed to set a default value to null for a
> referenced parameter (what I can do in C for a pointer, so I knew it).
>
> I'm happy PH
Stuart a écrit :
You appear to be using the definition of null that comes from the
world of C.
I didn't. The point is I'm allowed to set a default value to null for
a referenced parameter (what I can do in C for a pointer, so I knew it).
I'm happy PHP raises an error on foo(null) ;
I'
2009/7/6 Lupus Michaelis :
> Hi,
>
> I would like to know if I am alone to be shoked by this :
>
> == 8< ==
> function foo(& $bar = null)
> {
> }
>
> foo() ; // runs
> foo(null) ; // raise an error
> == >8 ==
>
> Why the default value to null for a reference is allowed ? Is it a bug, a
> feature
1 - 100 of 860 matches
Mail list logo