Nothadoth Posted August 16, 2006 Share Posted August 16, 2006 I have a question. At the moment I'm using a script to select and show all items from the database WHERE subcategoryname='$catmode'.Now on some of the ones catmode will be something simple like "Hardware". That's easy.However, i've had it so some of them are "All Hardware" (for example).Is there anyway to put before the WHERE query a code that will say for instance something like.if ($_GET['catmode'] contains "All ") {$catmode = $_GET['catmode'] without "All ";} else {$catmode = $_GET['catmode'];}Obviously that wouldn't work. But is there some way I can do something like that? Or not? Link to comment https://forums.phpfreaks.com/topic/17777-taking-all-out-of-a-variable/ Share on other sites More sharing options...
Prismatic Posted August 16, 2006 Share Posted August 16, 2006 One way,[code]<?phpif(strstr($_GET['catmode'], "All ")){ $catmode = str_replace("All ", "", $_GET['catmode']);}else{ $catmode = $_GET['catmode'];}?>[/code] Link to comment https://forums.phpfreaks.com/topic/17777-taking-all-out-of-a-variable/#findComment-75930 Share on other sites More sharing options...
Nothadoth Posted August 16, 2006 Author Share Posted August 16, 2006 It didn't work.However it seams looking at my site that I don't actually need this code when I thought I did. Thank you none the less :) Link to comment https://forums.phpfreaks.com/topic/17777-taking-all-out-of-a-variable/#findComment-75941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.