[ACCEPTED]-String compare not working-wordpress
Accepted answer
I guess one of the strings may contain trailing 2 whitespace or newline characters, so try 1 this:
if (trim($value) == trim($titelzor)) ...
Sometimes you should use multibyte comparison. You 4 can use the Collator object or use iconv 3 or mb_convert_encoding functions to convert 2 the string and after that, you can make 1 equal operation on it.
Try using strcmp:
https://www.php.net/manual/en/function.strcmp.php
It's probably an encoding 1 issue.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.