Re: [PHP] DateInterval

2009-04-29 Thread Raymond Irving
--- On Wed, 4/29/09, MIke Alaimo wrote: > > Raymond, have you tried using DateTime::modify?  It > appears to work like strtotime. > also DateTime::format works like date.  At least as > far as I can tell. > From the little documentation that I've seen it appears that it's similar to strtot

Re: [PHP] DateInterval

2009-04-29 Thread MIke Alaimo
Here is something i'd like to point out with DateInterval. $dInt = 'PT4320S'; $d = new DateInterval($dInt); var_dump($d); $dz = new DateTimeZone(UTC); $dt = new DateTime('now',$dz); $dt->add($d); var_dump($dt->format(DATE_ATOM)); It appears that running this code fails when it seems like it shou

[PHP] Two very useful PHP functions

2009-04-29 Thread Raymond Irving
Hello, Every so often I have to be using the isset() function to check if a variable exists. It would be useful to have something like an ifset() function Instead of doing this $v = isset($input) ? $input : $default; we can do this $v = ifset($input,$default); // returns $input if it exists

Re: [PHP] DateInterval

2009-04-29 Thread Raymond Irving
Sounds great Mike. I personally would also like to see standard date/time functions (strtotime, strftime, date, etc) support dates greater than 2038. I think this can be done internally by parsing the datetime value swith the DateInterval object and retuning the results to the standard function

[PHP] DateInterval

2009-04-29 Thread MIke Alaimo
Hello, I would like to know how to correctly use DateInterval::format(). The documentation is unclear. Also, I am willing to write some documentation for the DateInterval and DatePeriod if no one has taken the task. Thanks for the help. Mike -- PHP General Mailing List (http://www.php.ne

[PHP] Re: file_get_contents doesn't work on one particular server

2009-04-29 Thread Shawn McKenzie
Shawn McKenzie wrote: > Brian Dunning wrote: >> Howdy all - We have a production server that runs our script fine. We're >> setting up a test server, and this particular script returns a length of >> zero: >> >> $ctx = stream_context_create(array('http' => array('timeout' => 1200))); >> // 20 minut

[PHP] Re: file_get_contents doesn't work on one particular server

2009-04-29 Thread Shawn McKenzie
Brian Dunning wrote: > Howdy all - We have a production server that runs our script fine. We're > setting up a test server, and this particular script returns a length of > zero: > > $ctx = stream_context_create(array('http' => array('timeout' => 1200))); > // 20 minutes per file > $contents = fil

Re: [PHP] utf-8 ?

2009-04-29 Thread Reese
Tom Worster wrote: On 4/28/09 4:05 PM, "Reese" wrote: Granted, this isn't a PHP question but I'm curious, how does UTF-8 solve this display issue? if we're talking about web browsers, they are quite good at automatically choosing fonts that can display the unicode characters it finds in a pa

[PHP] Static and/or Dynamic site scraping using PHP

2009-04-29 Thread 9el
I just got a project to do on PHP of scraping the body items from static sites or just html sites. Could you experts please suggest me some quick resources? I have to make an WP plugin with the data as well. Regards Lenin www.twitter.com/nine_L -- PHP General Mailing List (http://www.php.net/

[PHP] file_get_contents doesn't work on one particular server

2009-04-29 Thread Brian Dunning
Howdy all - We have a production server that runs our script fine. We're setting up a test server, and this particular script returns a length of zero: $ctx = stream_context_create(array('http' => array('timeout' => 1200))); // 20 minutes per file $contents = file_get_contents($full_url, 0

Re: [PHP] Re: $_session/$_cookie trouble

2009-04-29 Thread Igor Escobar
A few days ago i had a problem similar to their and it was a problem with files with BOM signature... maybe its your case. Regards, Igor Escobar Systems Analyst & Interface Designer -- Personal Blog ~ blog.igorescobar.com Online Portifolio ~ www.igorescobar.com Twitter ~ @igorescobar On Tu

Re: [PHP] Boolean Parameter to 3 Options?

2009-04-29 Thread Matt Neimeyer
On Wed, Apr 29, 2009 at 1:30 PM, Shawn McKenzie wrote: > Philip Thompson wrote: >> On Apr 29, 2009, at 11:42 AM, Matt Neimeyer wrote: >> >>> I have a function that currently takes a boolean value as a parameter. >>> But now I want to expand it to 3 options... So if I have... >>> >>> function doFo

Re: [PHP] Boolean Parameter to 3 Options?

2009-04-29 Thread Shawn McKenzie
Philip Thompson wrote: > On Apr 29, 2009, at 11:42 AM, Matt Neimeyer wrote: > >> I have a function that currently takes a boolean value as a parameter. >> But now I want to expand it to 3 options... So if I have... >> >> function doFooBar($doFoo = false) >> { >> if($doFoo) >> { echo "Did

Re: [PHP] Programming Question

2009-04-29 Thread Kyle Smith
David Stoltz wrote: Hi Folks, I'm a PHP newbie - but this question really isn't about PHP per se', it's more about programming in general, and how to do something... I'm redesigning an ASP site with Dreamweaver CS4, so I'll be sticking to using ASP technology The site will use horizontal n

Re: [PHP] Boolean Parameter to 3 Options?

2009-04-29 Thread Philip Thompson
On Apr 29, 2009, at 11:42 AM, Matt Neimeyer wrote: I have a function that currently takes a boolean value as a parameter. But now I want to expand it to 3 options... So if I have... function doFooBar($doFoo = false) { if($doFoo) { echo "Did Foo"; } else { echo "Did Bar"; } }

[PHP] Programming Question

2009-04-29 Thread David Stoltz
Hi Folks, I'm a PHP newbie - but this question really isn't about PHP per se', it's more about programming in general, and how to do something... I'm redesigning an ASP site with Dreamweaver CS4, so I'll be sticking to using ASP technology The site will use horizontal navigation for the MAIN

[PHP] Re: Boolean Parameter to 3 Options?

2009-04-29 Thread Jo�o C�ndido de Souza Neto
Why not this: function doFooBar($doFoo = 0) { switch ($doFoo) { case 2: echo "Did Baz"; break; case 1: echo "Did Foo"; break; default: echo "Did Bar"; break; } } I think in this way you can avoid future pr

[PHP] Boolean Parameter to 3 Options?

2009-04-29 Thread Matt Neimeyer
I have a function that currently takes a boolean value as a parameter. But now I want to expand it to 3 options... So if I have... function doFooBar($doFoo = false) { if($doFoo) { echo "Did Foo"; } else { echo "Did Bar"; } } Is it as "simple" as changing it like follows t

RE: [PHP] E-Mail Verification - Yes, I know....

2009-04-29 Thread Bob McConnell
From: Simon > > There is no way to verify (without sending an email) if the email will > be received in a mailbox. Even that is not a valid test. Most spam filters will discard messages silently, that is without notifying either sender or recipient. So the only real verification is when you recei

[PHP] Re: E-Mail Verification - Yes, I know....

2009-04-29 Thread Al
Jay Blanchard wrote: Our company wants to do e-mail verification and does not want to use the requests / response method (clicking a link in the e-mail to verify the address), which as we all know is the only way you can be truly sure. I found this; http://verify-email.org/ Which seems to be

Re: [PHP] E-Mail Verification - Yes, I know....

2009-04-29 Thread Simon
The SMTP or POP3 protocol (cant remember which) used to support the ability to connect to the server and verify if a username exists before delivering the mail. But this feature was abused and was used for spamming so it is now disabled on all major servers (it's probably disabled by default in al

Re: [PHP] Developing PHP extensions on Windows with VC++, linking problems

2009-04-29 Thread Eugenio Tacchini
At 08.42 29/04/2009 +1000, Chris wrote: Eugenio Tacchini wrote: Hi all, I had to create a PHP extension and I read this article: http://www.talkphp.com/vbarticles.ph...php-extensions Everything

Re: [PHP] Re: Unit Testing

2009-04-29 Thread Darren Karstens
You are right, when doing unit tests you only want to test the functionality of the current class and so if there are errors its easier to track down which class is causing the problem. I personally use an api called SimpleTest for my php testing and what you can do with this is create Mock object