0

Hi

I have been going through a tutorial i came across online. Please let me know what this would read if it wasn't written in shorthand. Regards

$products = isset($_SESSION['products']) ? $_SESSION['products'] : array();
2
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by cereal
2

That's an IF statement:

if(isset($_SESSION['products']))
{
    $products = $_SESSION['products']; 
} else {
    $products = array();
}

Or

$products = array();
if(isset($_SESSION['products']))
{
    $products = $_SESSION['products']; 
}
Votes + Comments
Legend
0

Thank you very much. Even my lecturer didn't know lol

This question has already been answered. 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.