Hi guys,
I'm new to the forums and I really hope to learn alot from some of you more experienced PHP coders.
I have been stuck with a problem for a little while now and thought it may be a good idea to ask for help from others that may know how to achieve that i need to achieve.
Basically, i have an array that is giving me a single key with a value, like this:
Array
(
[mydata] => name=item1;date=2010-01-01;status=Active|name=item2;date=2010-01-01;status=Active
)
You will notice the value is split with a | character.
I basically need to take that and try match the name and status, of a specific item between the |
So, there may be 3 or 4 or 5 items in that value and I need to find a way to match a specific one.
I was thinking of exploding it and using the | as a delimiter, in which case I get:
Array (
[0] => name=item1;date=2010-01-01;status=Active
[1] => name=item2;date=2010-01-01;status=Active
)
But now i am stuck with what to do next.
I need to match the name and status of a specific item only. So, i would want to match against 'item1' and make sure that it's corresponding status is 'Active'
I tried to use in_array, but the problem there is that the date may always change and i cannot match against the whole value each time.
So, what i am asking is how can i do this without frying my brain too much?
If someone can please give me some pointers, i would be forever grateful.
Thank you very much.