[PHP] Re: Ranges for case statement and a WTF moment.

2011-04-05 Thread Richard Quadling
On 5 April 2011 16:28, Richard Quadling wrote: > Hi. > > I just wanted to quickly see if PHP supported ranges in its > switch/case statement (http://en.wikipedia.org/wiki/Ellipsis) > > $s = intval(date('s')); > switch($s) >        { >        case 0...9   : echo 'Between 0 and 9'; break; >        

[PHP] Ranges for case statement and a WTF moment.

2011-04-05 Thread Richard Quadling
Hi. I just wanted to quickly see if PHP supported ranges in its switch/case statement (http://en.wikipedia.org/wiki/Ellipsis) Completely unexpectedly, the above code runs but produces the wrong output. Interestingly, altering the number of dots and adding spaces all result in parse errors ...

Re: [PHP] randomly random

2011-04-05 Thread Stuart Dallas
On Tuesday, 5 April 2011 at 16:14, Jim Lucas wrote: On 4/5/2011 7:07 AM, Kirk Bailey wrote: > > OK gang, to spew a single line from a file of fortune cookies, I want to > > read it > > and echo one line. While I found a 4 line code which gets it done, I thought > > there was a preexisting command

Re: [PHP] randomly random

2011-04-05 Thread Jim Lucas
On 4/5/2011 7:07 AM, Kirk Bailey wrote: > OK gang, to spew a single line from a file of fortune cookies, I want to read > it > and echo one line. While I found a 4 line code which gets it done, I thought > there was a preexisting command to do exactly that. Any feedback on this? > No, but it can

Re: [PHP] randomly random

2011-04-05 Thread Richard Quadling
On 5 April 2011 15:07, Kirk Bailey wrote: > OK gang, to spew a single line from a file of fortune cookies, I want to > read it and echo one line. While I found a 4 line code which gets it done, I > thought there was a preexisting command to do exactly that. Any feedback on > this? motd maybe.

[PHP] randomly random

2011-04-05 Thread Kirk Bailey
OK gang, to spew a single line from a file of fortune cookies, I want to read it and echo one line. While I found a 4 line code which gets it done, I thought there was a preexisting command to do exactly that. Any feedback on this? -- end Very Truly yours, - Kirk Bailey,

[PHP] Re: DateTime using DateTimeZone Timestamp problem

2011-04-05 Thread Ian
On 05/04/2011 10:11, Simon J Welsh wrote: > On 5/04/2011, at 3:35 AM, Ian wrote: > >> Hi, >> >> I have a problem using the php built in classes DateTime and DateTimeZone. >> >> The idea behind the following code is to return the timestamp for the >> current time in Singapore (or other places). Wh

Re: [PHP] DateTime using DateTimeZone Timestamp problem

2011-04-05 Thread Richard Quadling
On 4 April 2011 16:35, Ian wrote: > Hi, > > I have a problem using the php built in classes DateTime and DateTimeZone. > > The idea behind the following code is to return the timestamp for the > current time in Singapore (or other places).  What it actually returns > is the timestamp for the local

Re: [PHP] DateTime using DateTimeZone Timestamp problem

2011-04-05 Thread Simon J Welsh
On 5/04/2011, at 3:35 AM, Ian wrote: > Hi, > > I have a problem using the php built in classes DateTime and DateTimeZone. > > The idea behind the following code is to return the timestamp for the > current time in Singapore (or other places). What it actually returns > is the timestamp for the

[PHP] Re: DateTime using DateTimeZone Timestamp problem

2011-04-05 Thread Ian
On 04/04/2011 18:02, Ashley Sheridan wrote: > > What do you mean it only returns the timestamp for the local system? Did > you want PHP to know what time the visitors are on? PHP won't know about > that, all you can do is set the timezone for the script based on some > information you're receivi

Re: [PHP] Please help with glob

2011-04-05 Thread Al Mangkok
Yesterday I yum installed these: glibc-common.i386 2.3.4-2.54 glibc.i686 2.3.4-2.54 glibc-headers.i386 2.3.4-2.54 glibc-devel.i386 2.3.4-2.54 And about ten minutes ago I recompiled PHP with identical configure options as before. And this time the glob function is inside PHP. Phew. Hopefully someo