Re: [PHP] regexp novice

2012-05-18 Thread Andreas Perstinger
On 2012-05-17 22:37, Jim Giner wrote: Trying to validate an input of a time value in the format hh:mm, wherein I'll accept anything like the following: hmm hhmm h:mm hh:mm in a 12 hour format. My problem is my test is ok'ing an input of 1300. Here is my test: if (0 == preg_match("/([0][1-9]

Re: [PHP] Unexpected behavior of max() function

2012-12-10 Thread Andreas Perstinger
On 11.12.2012 07:48, "Рогулин С.В." wrote: I encountered with unexpected behavior of max() function. When i pass a parameter ['100', '110,453351020813', '9'], this function gives answer '9' var_dump( max(array('100', '110,453351020813', '9')) ); // will output: // string(1) "9" As the out

Re: [PHP] Boolean type forced on string assignment inside if statement

2013-01-03 Thread Andreas Perstinger
Volmar Machado wrote: >When the one of the operators were 2, the cases with "<" >returns 2 otherwise returns 0 (Or 1 when any operator is 1). And if >the operators are 1 and 2, return 0 too. Its curious for me. & is the bitwise and operator. You have to look at the binary representati

Re: [PHP] need some regex help to strip out // comments but not http:// urls

2013-05-28 Thread Andreas Perstinger
On 28.05.2013 23:17, Daevid Vincent wrote: I'm adding some minification to our cache.class.php and am running into an edge case that is causing me grief. I want to remove all comments of the // variety, HOWEVER I don't want to remove URLs... You need a negative look behind assertion ( http://