[PHP] PhpBrew is released

2012-02-08 Thread Lin Yo-An
Hi folks, phpbrew builds and installs multiple version php(s) in your $HOME directory. phpbrew is like php-build , but phpbrew also manage the environment variables, so you can switch php version whenever you need. phpbrew is on GitHub: https://github.com/c9s/phpbrew patches are welcomed. Be

Re: Re: Re: [PHP] What's Your Favorite Design Pattern?

2012-02-08 Thread Tim Streater
On 07 Feb 2012 at 22:31, Paul M Foster wrote: > Design Patterns are Way Nifty Kewl patterns of code which are supposed > to facilitate certain types of operations. (Was that sarcasm you > detected? Yes it was.) > > For example, the Singleton pattern. Let's say you had a configuration > class tha

[PHP] sticky checkbox - strpos

2012-02-08 Thread Donovan Brooke
Hi guys, if (!strpos($t_product,$t_p)) {print "checked";} Would strpos be munged if $t_p contains commas?.. ie ",234," Thanks, Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] sticky checkbox - strpos

2012-02-08 Thread Donovan Brooke
Donovan Brooke wrote: if (!strpos($t_product,$t_p)) {print "checked";} Nevermind.. bad syntax I guess.. this works: (strpos($t_product,$t_p) !== false) Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] sticky checkbox - strpos

2012-02-08 Thread Marc Guay
>> if (!strpos($t_product,$t_p)) {print "checked";} It could have something to do with the function returning 0 because it's finding the comma in the 0 index, but it's not really false, it's still finding the string. I've run into a similar problem before... Marc -- PHP General Mailing List (h

Re: Re: Re: [PHP] What's Your Favorite Design Pattern?

2012-02-08 Thread Paul M Foster
On Wed, Feb 08, 2012 at 02:25:00PM +, Tim Streater wrote: [snip] > Mmmm. Well, at this point I feel underwhelmed - but its entirely > possible that I'm missing something profound [1]. Not really. > After looking at some of the reviews of the book you mention on > Amazon, I might be in

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Larry Garfield
On 2/7/12 1:50 PM, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: ... and it looks like having that comma ain't no big deal. I can't believe that I alw

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Robert Cummings
On 12-02-07 02:50 PM, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: ... and it looks like having that comma ain't no big deal. I can't believe that I

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Micky Hulse
On Wed, Feb 8, 2012 at 9:58 AM, Larry Garfield wrote: > Drupal's coding standards encourage the extra trailing comma on multi-line > arrays, for all the readability and editability benefits that others have > mentioned.  We have for years.  Cool stuff. :-) Yah, I love that syntax guideline/rule i

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Micky Hulse
On Wed, Feb 8, 2012 at 10:08 AM, Robert Cummings wrote: > JavaScript in Internet Crapsplorer spanks you on the bottom every time you > have a trailing comma in a JS array. That may be where you picked up the > aversion. On Wed, Feb 8, 2012 at 10:10 AM, Micky Hulse wrote: > I am just surprised th

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Robert Cummings
On 12-02-08 01:12 PM, Micky Hulse wrote: On Wed, Feb 8, 2012 at 10:08 AM, Robert Cummings wrote: JavaScript in Internet Crapsplorer spanks you on the bottom every time you have a trailing comma in a JS array. That may be where you picked up the aversion. On Wed, Feb 8, 2012 at 10:10 AM, Micky

[PHP] Help! Having trouble getting one XML field from this feed reliably

2012-02-08 Thread Rob Gould
Can anyone tell me what I'm doing wrong here? I'm trying to get the VASTAdTagURI field from the XML data at this url: http://afe.specificclick.net/?l=32259&t=x&rnd=123456 Here's my code. (below). It works maybe 30% of the time, but most of the time it just returns nothing from that field.

Re: [PHP] Help! Having trouble getting one XML field from this feed reliably

2012-02-08 Thread Adam Richardson
On Wed, Feb 8, 2012 at 10:44 PM, Rob Gould wrote: > Can anyone tell me what I'm doing wrong here? I'm trying to get the > VASTAdTagURI field from the XML data at this url: > > http://afe.specificclick.net/?l=32259&t=x&rnd=123456 > > > > > Here's my code. (below). It works maybe 30% of the time