Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.