justinh Posted January 22, 2009 Share Posted January 22, 2009 Okay let's say $item_to_add is "Horse". if it was in a session it would be horse|1 where 1 is the qty I'm trying to see if $item_to_add is set within the session, but i need to add a wildcard at the end of it because the qty might be 1,2,3 etc.. if ( ! isset($_SESSION['items']['$item_to_add**need to add some sort of wildcard here**'] ) ) Please help, this project is due at the end of the day, i would greatly apprieciate it. Link to comment https://forums.phpfreaks.com/topic/142004-wildcard-in-php/ Share on other sites More sharing options...
Zhadus Posted January 22, 2009 Share Posted January 22, 2009 Instead of coming up with a wildcard, use regex or strpos(). Link to comment https://forums.phpfreaks.com/topic/142004-wildcard-in-php/#findComment-743550 Share on other sites More sharing options...
flyhoney Posted January 22, 2009 Share Posted January 22, 2009 Why not just change the way you store it in the session? $_SESSION['items'][$item_to_add][] = $quantity; Link to comment https://forums.phpfreaks.com/topic/142004-wildcard-in-php/#findComment-743569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.