A
A
Alexander2015-11-03 11:46:27
PHP
Alexander, 2015-11-03 11:46:27

Why are two strings not equal?

Friends. I'm parsing information. In the information processing algorithm, you need to compare the names:
I compare

$mysername = trim(stripslashes(strtolower($myrow2['origname'])));
$parssername = trim(stripslashes(strtolower($origname['1'])));

if ($mysername == $parssername) {
echo 333;
}

Bottom line: strings are not equal!
The lines themselves: it's a date - it's a date
Tell me, what could be the problem?
Maybe there are Russian letters 'e' or 'a' in the parsed string? how can i translate each letter into its code and check?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Kubintsev, 2015-11-03
@akubintsev

ide + xdebug to the rescue

I
Ivanq, 2015-11-03
@Ivanq

$a=trim(stripslashes(strtolower($myrow2['origname'])));
$b=trim(stripslashes(strtolower($origname['1'])));
echo htmlspecialchars_decode($a) == htmlspecialchars_decode($b);

D
Dmitry, 2017-02-21
@Thelema

the function helped me - html_entity_decode

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question