Extracting from an Array
| From: | Andre Dubuc | Date: | Wed, 12 Jun 2002 23:10:40 +0000 |
| Subject: | Extracting from an Array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-101828@lists.php.net to get a copy of this message | ||
I have a db field, type varchar, that is actually a 'date' string formatted
as dd-mm-YYYY. I used type 'varchar' (rather than type 'date') since I had to
accomplish other things with it.
Now, however, I do need to extract the Year (the last four digits in the
array). I've tried to access the array $_SESSION['expiry'] but I don't know
how to explode this array to extract all characters in last item after the
last separator : i.e. '-YYYY'. I've used "-" as the separator, but I just
get the first number of the last part of the array, i.e.: '-Y'.
Is there a way of extracting all characters in that array?
I've tried a bunch of combinations, but I obviously don't understand the
basic mechanics of array manipulation or 'slicing'. If someone could point me
to a good resource, or explain what I'm doing wrong, I would greatly any
assistance.
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/