php-general Digest 29 Mar 2012 16:23:39 -0000 Issue 7751

2012-03-29 Thread php-general-digest-help
php-general Digest 29 Mar 2012 16:23:39 - Issue 7751 Topics (messages 317334 through 317337): Re: Uploading and creating an email attachment, WITHOUT aDB on server 317334 by: tamouse mailing lists Re: updating code asap to multiple domains, windows to unix, with source control

[PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
Can someone explain to me this weierdness I see when using the DateTime module of PHP. Here I send 14/14/2012 which is not a valid date, and I would expect to recieve false, but instead, it looks like it wrapping to the next year, as if 14 monthas are 1 year and 2 months. That isn't what's

[PHP] Watch out for automatic type casting

2012-03-29 Thread Arno Kuhl
I found automatic typecasting can be a bit of a gotcha. $sText = this.is.a.test.text; if ( $pos = strpos($sText, test) !== FALSE) { echo substr($sText, 0, $pos)..substr($sText, $pos, strlen(test))..substr($sText, $pos+strlen(test)); } The code seems logical enough, and

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
echo date(m-d-y,mktime(0, 0, 0, 14, 14, 2012)); this outputs 02-14-13 also so my guess is that it is being interpreted the same as 12/14/2012 +2 months echo date(m-d-y,mktime(0, 0, 0, 1, 45, 2012)); outputs 02-14-12 which is 1/1/12 +45 days 2012/3/29 Martín Marqués martin.marq...@gmail.com

Re: [PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
OK. So what would be a good way to validate a date? El día 29 de marzo de 2012 14:04, David OBrien dgobr...@gmail.com escribió: echo date(m-d-y,mktime(0, 0, 0, 14, 14, 2012)); this outputs 02-14-13 also so my guess is that it is being interpreted the same as  12/14/2012 +2 months echo

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
http://www.php.net/manual/en/function.checkdate.php 2012/3/29 Martín Marqués martin.marq...@gmail.com OK. So what would be a good way to validate a date? El día 29 de marzo de 2012 14:04, David OBrien dgobr...@gmail.com escribió: echo date(m-d-y,mktime(0, 0, 0, 14, 14, 2012)); this

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread Simon Schick
Hi, Arno I don't know if this is written somewhere in the php-manual, but I really like this table: http://en.wikipedia.org/wiki/Order_of_operations#Programming_languages I do not really understand why this has some special stuff to do with typecasting ... This is just an order like the

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
actually this would work well ... compare what they send with the output of the formatdate function checkDateTime($data) { if (date('Y-m-d H:i:s', strtotime($data)) == $data) { return true; } else { return false; } } 2012/3/29 David OBrien dgobr...@gmail.com

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread Simon Schick
Hi, Arno FYI: I found a page in the php-manual that's exactly for that: http://www.php.net/manual/en/language.operators.precedence.php p.s. some of them were also new to me Thanks for getting me to read it. Bye Simon 2012/3/29 Simon Schick simonsimc...@googlemail.com: Hi, Arno I don't

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 17:57, Arno Kuhl wrote: I found automatic typecasting can be a bit of a gotcha. $sText = this.is.a.test.text; if ( $pos = strpos($sText, test) !== FALSE) { echo substr($sText, 0, $pos)..substr($sText, $pos, strlen(test))..substr($sText,

Re: [PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
El día 29 de marzo de 2012 14:14, David OBrien dgobr...@gmail.com escribió: actually this would work well ... compare what they send with the output of the formatdate function checkDateTime($data) {     if (date('Y-m-d H:i:s', strtotime($data)) == $data) {         return true;     } else {

[PHP] Re: [PHP-DB] Flow of PHP testClass

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 9:57 AM, Rikin Parekh riki...@gmail.com wrote: Hi Guys, Given below is a PHP script. Can someone help me with the output of the code. According to my understanding the output should be 3, 50, 20, 10. Can someone elaborate on the same and provide me an explanation on

[PHP] Re: [PHP-DB] Flow of PHP testClass

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 1:17 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: On Thu, Mar 29, 2012 at 9:57 AM, Rikin Parekh riki...@gmail.com wrote: Hi Guys, Given below is a PHP script. Can someone help me with the output of the code. According to my understanding the output should

[PHP] Re: [PHP-DB] Flow of PHP testClass

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 1:30 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: On Thu, Mar 29, 2012 at 1:17 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: On Thu, Mar 29, 2012 at 9:57 AM, Rikin Parekh riki...@gmail.com wrote: Hi Guys, Given below is a PHP script. Can someone

Re: [PHP] DateTime wierdness

2012-03-29 Thread tamouse mailing lists
2012/3/29 Martín Marqués martin.marq...@gmail.com: El día 29 de marzo de 2012 14:14, David OBrien dgobr...@gmail.com escribió: actually this would work well ... compare what they send with the output of the formatdate function checkDateTime($data) {     if (date('Y-m-d H:i:s',

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 12:19 PM, Stuart Dallas stu...@3ft9.com wrote: On 29 Mar 2012, at 17:57, Arno Kuhl wrote: I found automatic typecasting can be a bit of a gotcha. $sText = this.is.a.test.text; if ( $pos = strpos($sText, test) !== FALSE) {                echo  substr($sText, 0,

[PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Ralf Gnädinger
Hi, i got some trouble with a PHP script using pcntl_fork do run some work in background. Runnig my script on my development system (PHP version 5.3.3-7) it behaves like intended. But running it on my production test system (PHP version PHP 5.1.2), i got some strange results. The problem is, that

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Jim Lucas
On 03/29/2012 12:49 PM, Ralf Gnädinger wrote: Hi, i got some trouble with a PHP script using pcntl_fork do run some work in background. Runnig my script on my development system (PHP version 5.3.3-7) it behaves like intended. But running it on my production test system (PHP version PHP 5.1.2),

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 20:49, Ralf Gnädinger wrote: i got some trouble with a PHP script using pcntl_fork do run some work in background. Runnig my script on my development system (PHP version 5.3.3-7) it behaves like intended. But running it on my production test system (PHP version PHP

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Ralf Gnädinger
development os is Debian GNU/Linux 6.0 test os is SUSE LINUX 10.1 (i586) Am 29. März 2012 23:02 schrieb Jim Lucas li...@cmsws.com: On 03/29/2012 12:49 PM, Ralf Gnädinger wrote: Hi, i got some trouble with a PHP script using pcntl_fork do run some work in background. Runnig my script on my

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Ralf Gnädinger
I will try posix_setsid(). Both machines were accessed via a ssh client (e.g. putty or ssh from a other linux box). Thanks for your advice. Am 29. März 2012 23:08 schrieb Stuart Dallas stu...@3ft9.com: On 29 Mar 2012, at 20:49, Ralf Gnädinger wrote: i got some trouble with a PHP script

[PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
Anyone know a way to update Google Plus via the 33669 SMS number? Yes, I have seen the popular how-to instructions to get the secret email address by using Google Voice and forcing the error message, but I'd prefer a legit non-hack way to do it. I'd even be happy to pay for an SMS gateway

Re: [PHP] Updating Google Plus

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 22:44, Brian Dunning wrote: Anyone know a way to update Google Plus via the 33669 SMS number? Yes, I have seen the popular how-to instructions to get the secret email address by using Google Voice and forcing the error message, but I'd prefer a legit non-hack way to do

Re: [PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
Sorry, I did not mention the implied using PHP. Since everything I do eat breathe is PHP, it didn't even occur to me to state the obvious. :-) :-) On Mar 29, 2012, at 2:46 PM, Stuart Dallas wrote: Err, what has this got to do with PHP?!? -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Updating Google Plus

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 22:44, Brian Dunning wrote: Anyone know a way to update Google Plus via the 33669 SMS number? Yes, I have seen the popular how-to instructions to get the secret email address by using Google Voice and forcing the error message, but I'd prefer a legit non-hack way to do

Re: [PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
That's EXACTLY what I was looking for. Thanks! Don't know why my Google-Fu failed me... :-) On Mar 29, 2012, at 5:26 PM, Don Wieland wrote: First Google+ (Google Plus) status update bot in PHP http://360percents.com/posts/first-google-google-plus-status-update-bot-in-php/ Is that what you