Re: [PHP] array question

2010-12-17 Thread Sorin Buturugeanu
Tanks for all of your responses! I guess a function is the way to go. I just have to see if the situation comes up enough times to justify the function approach. @Dan: I really enjoyed your disclaimer :D -- Sorin Buturugeanu www.soin.ro

Re: [PHP] array question

2010-12-17 Thread Daniel Brown
On Fri, Dec 17, 2010 at 15:52, Sorin Buturugeanu wrote: > Hello all! > > I have a question regarding arrays and the way I can use a value. > > Let's say I have this string: > > $s = 'banana,apple,mellon,grape,nut,orange' > > I want to explode it, and get the third value. For this I would normally

RE: [PHP] array question

2010-12-17 Thread Jay Blanchard
[snip] I have a question regarding arrays and the way I can use a value. Let's say I have this string: $s = 'banana,apple,mellon,grape,nut,orange' I want to explode it, and get the third value. For this I would normally do: $a = explode(',', $s); echo $s[2]; That's all fine, but is there a way

[PHP] array question

2010-12-17 Thread Sorin Buturugeanu
Hello all! I have a question regarding arrays and the way I can use a value. Let's say I have this string: $s = 'banana,apple,mellon,grape,nut,orange' I want to explode it, and get the third value. For this I would normally do: $a = explode(',', $s); echo $s[2]; That's all fine, but is there

Re: [PHP] How to define a data range for graphing?

2010-12-17 Thread Peter Lind
On Friday, 17 December 2010, Simon J Welsh wrote: > On 18/12/2010, at 8:45 AM, Brian Dunning wrote: > >> Hey all - >> >> I'm trying to provide reporting to users of our widget. Some may get 0 to 5 >> hits a day; others may get up to 10,000 hits a day. I need to define the >> range of the graph (

Re: [PHP] How to define a data range for graphing?

2010-12-17 Thread Simon J Welsh
On 18/12/2010, at 8:45 AM, Brian Dunning wrote: > Hey all - > > I'm trying to provide reporting to users of our widget. Some may get 0 to 5 > hits a day; others may get up to 10,000 hits a day. I need to define the > range of the graph (using one of Google's). If their max day is 7, I'd like >

[PHP] How to define a data range for graphing?

2010-12-17 Thread Brian Dunning
Hey all - I'm trying to provide reporting to users of our widget. Some may get 0 to 5 hits a day; others may get up to 10,000 hits a day. I need to define the range of the graph (using one of Google's). If their max day is 7, I'd like the graph to go from 0 to 10. If their max day is 5678, I'd

Re: [PHP] Problems w/ goto

2010-12-17 Thread la...@garfieldtech.com
On 12/17/10 11:57 AM, Steve Staples wrote: I had to show the people in my office, and we all got a chuckle from teh XKCD comic in the PHP documentation for GOTO http://ca2.php.net/goto Steve I was one of the people that argued in favour of GOTO on the Internals list a few years ago. GOTO has

Re: [PHP] Problems w/ goto

2010-12-17 Thread Daniel P. Brown
On Fri, Dec 17, 2010 at 12:22, Robert Cummings wrote: > > I was one of the people that argued in favour of GOTO on the Internals list > a few years ago. GOTO has a use, and a very good one at that. It is by far > the most efficient construct when creating parsers or other similar types of > logic

[PHP] Re: [PHP-DB] Re: [PHP] Problems w/ goto

2010-12-17 Thread Daniel Brown
On Fri, Dec 17, 2010 at 12:16, Richard Quadling wrote: > > And have you seen all the sad faces ... > > : { > > on http://docs.php.net/manual/en/control-structures.goto.php#92763 > > Can't be good for them. If only people knew how many hours - literally, hours - it took me to keep that page cl

Re: [PHP] Problems w/ goto

2010-12-17 Thread Steve Staples
On Fri, 2010-12-17 at 12:22 -0500, Robert Cummings wrote: > On 10-12-17 12:08 PM, Steve Staples wrote: > > On Fri, 2010-12-17 at 10:50 -0600, Jay Blanchard wrote: > >> [snip] > >> Thank you with your excellent help in the past. Here is another > >> puzzler > >> > >> I am trying to write a prog

Re: [PHP] Problems w/ goto

2010-12-17 Thread Daniel Brown
On Fri, Dec 17, 2010 at 11:38, Ethan Rosenberg wrote: > > I am trying to write a program that can have two(2) independent forms in one > PHP file.  When I run the code below [from PHP - A Beginner's Guide], to > which I have added a second form, it freezes. [snip!] > What did I do wrong? You

Re: [PHP] HTML id attribute and arrays

2010-12-17 Thread Benjamin Hawkes-Lewis
Martin C wrote: > How should I follow the HTML specification while having the passed > parameters automatically converted to arrays in PHP? The "name" attribute, not the "id" attribute, is used as the key when submitting form values. The "name" and "id" attributes do not have to be the same. --

[PHP] HTML id attribute and arrays

2010-12-17 Thread Martin C
Hi, PHP converts x[a]=b parameter of the HTTP request as an array named x with its item named a set to value b. So, it seems possible to have the following (X)HTML code: Unfortunatelly, HTML specification does not allow neither "[" nor "]" inside the id attribute. Specifically: * Must begin

Re: [PHP] Problems w/ goto

2010-12-17 Thread Robert Cummings
On 10-12-17 12:08 PM, Steve Staples wrote: On Fri, 2010-12-17 at 10:50 -0600, Jay Blanchard wrote: [snip] Thank you with your excellent help in the past. Here is another puzzler I am trying to write a program that can have two(2) independent forms in one PHP file. When I run the code belo

Re: [PHP] Problems w/ goto

2010-12-17 Thread Nicholas Kell
On Dec 17, 2010, at 11:08 AM, Steve Staples wrote: [snip /] >> >> >> GOTO should never be used like this. >> >> GOTO should never be used. >> > > Wow... that brought me back to 1990... using basic and batch files... > I honestly didn't even know that the GOTO was still in existence, > espec

Re: [PHP] Problems w/ goto

2010-12-17 Thread Richard Quadling
On 17 December 2010 17:08, Steve Staples wrote: > On Fri, 2010-12-17 at 10:50 -0600, Jay Blanchard wrote: >> [snip] >> Thank you with your excellent help in the past.  Here is another >> puzzler >> >> I am trying to write a program that can have two(2) independent forms >> in one PHP file.  Wh

RE: [PHP] Problems w/ goto

2010-12-17 Thread Steve Staples
On Fri, 2010-12-17 at 10:50 -0600, Jay Blanchard wrote: > [snip] > Thank you with your excellent help in the past. Here is another > puzzler > > I am trying to write a program that can have two(2) independent forms > in one PHP file. When I run the code below [from PHP - A Beginner's > Gui

Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-17 Thread Kris Deugau
Nathan Nobbe wrote: 2. try modifying Tag & SelectBoxOption to have __construct() instead of Tag() & SelectBoxOption(), then call parent::__construct() from inside of SelectBoxOption::__construct(); see if that clears up your problem under 5.2 (read: this will only be a partial solution as it on

RE: [PHP] Problems w/ goto

2010-12-17 Thread Jay Blanchard
[snip] Thank you with your excellent help in the past. Here is another puzzler I am trying to write a program that can have two(2) independent forms in one PHP file. When I run the code below [from PHP - A Beginner's Guide], to which I have added a second form, it freezes. Without the go

Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-17 Thread Kris Deugau
David Harkness wrote: I've never used the old-style constructors, but perhaps the semantics of "parent::" changed and you need to instead use "$this->" as in $this->Tag("option", $name); That's a total guess. I don't have 5.2 handy to try it out, but both work in 5.3 using a simple example.

[PHP] Problems w/ goto

2010-12-17 Thread Ethan Rosenberg
Dear List - I am sending this again since it does not seem to have posted. Ethan +++ Dear List - Thank you with your excellent help in the past. Here is another puzzler I am trying to write a program that can have two(2) independent forms in one PHP file. When I run the code below [

Re: [PHP]Confusion About WordPress Cache

2010-12-17 Thread Daniel Brown
On Fri, Dec 17, 2010 at 09:32, Nicholas Kell wrote: > On Dec 17, 2010, at 8:21 AM, 肖晗 wrote: >> I am using WordPress Cache to cache data retrieved from database, using >> WP_Cache . [snip!] >> >> Can anyone help? Or it is not what I am thinki

Re: [PHP] PHPInfo disabled due to security

2010-12-17 Thread Daniel Brown
On Thu, Dec 16, 2010 at 23:39, Paul S wrote: > > Well, I was hoping for stronger arguments to get that DONE. I would think > there be something in the PHP license > that would FORBID disabling functionality. Really? You would really think that? Because we wouldn't. > After all, 'phpinfo' i

Re: [PHP]Confusion About WordPress Cache

2010-12-17 Thread Nicholas Kell
On Dec 17, 2010, at 8:21 AM, 肖晗 wrote: > I am using WordPress Cache to cache data retrieved from database, using > WP_Cache . > > After I used wp_cache_set to set some data in the cache, I try to get it by > wp_cache_get in ANOTHER post re

Re: [PHP] PHPInfo disabled due to security

2010-12-17 Thread Nicholas Kell
On Dec 16, 2010, at 10:39 PM, Paul S wrote: > On Thu, 16 Dec 2010 00:13:31 +0700, "Daniel P. Brown" > wrote: > > >> >>Well, phpinfo() does, by default, divulge some things that could >> be considered security concerns --- particularly in poorly-managed >> environments. Primarily, this is

[PHP]Confusion About WordPress Cache

2010-12-17 Thread 肖晗
I am using WordPress Cache to cache data retrieved from database, using WP_Cache . After I used wp_cache_set to set some data in the cache, I try to get it by wp_cache_get in ANOTHER post request. However, it failed to retrieve the data I h