web2000 Posted February 1, 2008 Share Posted February 1, 2008 Hello, I have the following PHP statement: if($check_total['title']!='Total:' and $check_total['title']!='Credit:' and $check_total['title']!='Discount Coupon' and $check_total['title']!='Vat:') It is a very simple If then else statement, what i need is where it is and $check_total['title']!='Discount Coupon' I need it to be a like parameter as there may be other text after the Discount Coupon part, i tried LIKE with the % but i think this only relates to mysql. Any help would be great thanks Quote Link to comment https://forums.phpfreaks.com/topic/88974-php-like-parameter/ Share on other sites More sharing options...
Barand Posted February 1, 2008 Share Posted February 1, 2008 and strpos($check_total['title'], 'Discount Voucher')===false Quote Link to comment https://forums.phpfreaks.com/topic/88974-php-like-parameter/#findComment-455689 Share on other sites More sharing options...
web2000 Posted February 1, 2008 Author Share Posted February 1, 2008 Hi, Thanks for that, it didnt work for some reason? The code was perfect but it doesnt seem to work with anything with Discount Voucher on its own or with Discount Voucher then Something after it. Any ideas why? The code now looks like below, Thanks if($check_total['title']!='Total:' and $check_total['title']!='Credit:' and strpos($check_total['title'], 'Discount Voucher')===true and $check_total['title']!='Vat:') Quote Link to comment https://forums.phpfreaks.com/topic/88974-php-like-parameter/#findComment-455712 Share on other sites More sharing options...
web2000 Posted February 2, 2008 Author Share Posted February 2, 2008 Perfect it did work, sorry i has the text voucher instead of coupon so didnt work. Thank you very much for your help Quote Link to comment https://forums.phpfreaks.com/topic/88974-php-like-parameter/#findComment-455732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.