RE: [PHP] Augmenting an old date
Wow this is a pretty cool function. I was playing with it and you can add like +30 days + 99 seconds together and it works. -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: May 19, 2002 1:07 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Augmenting an old date Hi A slightly more efficeint way :) ? $start = 2002-01-01; $expire = date(Y-m-d,strtotime($start +30 days)); echo $expire.br; ? Tom At 02:03 PM 19/05/2002, Andre Dubuc wrote: Two columns in my PostgreSQL db are type 'date' (formatted '-mm-dd'): 'start_date' and 'expiry_date'. What I cannot seem to figure out is how to augment the 'expiry_date' either by 30 days, 60 days, or 1 year. I've tried the date function in PHP (getdate) but the problem is that it appears to need a timestamp of today. The dates that I'm trying to augment are sometimes a year or two ago. This doesn't work: $new_expiry_date = $expiry_date(Y-m-d, mktime(0,0,0, date(Y), date(m), date(d) + 60))); I assume it's because the '$expiry_date' should be simply 'date', but that would give the current date which is not what is wanted. Is there anyway to set 'date' as '$expiry_date'? Suggestions, admonitions, and general advice will be greatly appreciated. Btw, I've searched the archives, and haven't found anything quite on this topic. Tia, Andre -- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the Holy Souls in Purgatory. May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions
Hello everyone, Simple question: Will registering a variable twice, using session_register(), reset the value of the variable to a different value? I just now started using the session_is_registered() function on all sessions to see if they have been registered already, before I register them yet again. But now I'm wondering about the inner workings of the session itself. PHP.net doesn't do a very good job at explaining the details. Thanks in advance for anyone's help. Navid -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file upload problem
On Sat, 18 May 2002, Rodney Davis wrote: I am trying to use the move_uploaded_file() function to upload files to a specific directory. It works fine with small .jpgs .txt etc etc but won't work with a large .mp3 file. Is this because it is too large? What can I do? You can tell us what won't work means. Do the police come to your door? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.net sloooooooowwww
Anyone know why http://www.php.net is s incredibly slow today (all day) ??? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions
On Sun, 19 May 2002, Navid Y. wrote: Simple question: Will registering a variable twice, using session_register(), reset the value of the variable to a different value? session_register() adds a variable to the list of variables that are tracked by the session. If the variable has already been registered, then it has no effect. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regex (preg_replace)
I figured it out. Change the last line to echo htmlspecialchars($b); and you'll get the proper output. Gerard Samuel wrote: Im trying to get a final output to be 'item' but Im unable to get working. Could someone point me where Im going wrong. Thanks ?php $a = 'item rdf:about=http://www.trini0.org;'; $b = preg_replace(/(item)(\s.*)()/i, $1 . $3, $a ); echo $b; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net sloooooooowwww
On Sat, 18 May 2002, Jason Caldwell wrote: Anyone know why http://www.php.net is s incredibly slow today (all day) ??? Dunno, I've been doing my own armchair load balancing by typing us2.php.net instead of php.net all day. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Read a var from stdin
On Sat, 18 May 2002, Rafael Perazzo wrote: Is there any way to ask the user to type the value of a variable from stdin ? (like read in Pascal, or scanf in C). I'm using PHP from command line. ? $f = fopen('php://stdin', 'r'); // this line answers your question while ($l = fgets($f, 100)) print strtoupper($l); fclose($f); ? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net sloooooooowwww
Seems to be an old main page on php.net too, us2.php.net shows 4.2.1 released, php.net doesn'.t :) Mike - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, May 19, 2002 1:35 AM Subject: Re: [PHP] php.net sl On Sat, 18 May 2002, Jason Caldwell wrote: Anyone know why http://www.php.net is s incredibly slow today (all day) ??? Dunno, I've been doing my own armchair load balancing by typing us2.php.net instead of php.net all day. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.net sloooooooowwww
Is there some place else I can download release 4.2.1 ??? www.php.net is dead slow, and us2.php.net is taking forever to prompt me for the download -- I keep getting hit with the Page Cannot be Displayed error. Looking for the Win32 binary. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.net sloooooooowwww
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Jason Caldwell) wrote: Is there some place else I can download release 4.2.1 ??? www.php.net is dead slow, and us2.php.net is taking forever to prompt me for the download -- I keep getting hit with the Page Cannot be Displayed error. Have you tried any of the other mirrors, for example uk.php.net? I'm not sure why us2 is giving you a problem, but hopefully other mirrors would not do the same... -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php