0

This is how my session reads:

Array
(
    [pstloggedin] => blah
    [userID] => blah
    [email] => blah
    [fname] => blah
    [lname] => blah
    [phone] => blah
    [cart] => Array
        (
            [0] => Array
                (
                    [team] => 2137
                    [tournament] => 24577
                    [gatefee] => yes
                    [cost] => 800
                    [sdate] => 2010-06-03
                    [edate] => 2010-06-06
                )

            [1] => Array
                (
                    [team] => 2137
                    [tournament] => 24600
                    [gatefee] => 
                    [cost] => 675
                    [sdate] => 2010-06-10
                    [edate] => 2010-06-13
                )

        )
)

When a user goes to add another event to their cart, I want to check this session array to make sure this event isnt already in their cart.

I need to make sure [team] and [tournament] are not already inside one of these arrays above. I get the team and tournament ids from a GET Statement upon adding to the cart.

Any help would be great, thanks.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by CFROG
0

Example:

$array = array('this', 'that', 'the_other');

if(in_array('this', $array))
{
     echo 'True';
} else { echo 'False'; }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.