Jump to content

PHP Like Parameter


web2000

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/88974-php-like-parameter/
Share on other sites

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:')

Link to comment
https://forums.phpfreaks.com/topic/88974-php-like-parameter/#findComment-455712
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.