A
A
Alexander2016-02-11 12:39:31
PHP
Alexander, 2016-02-11 12:39:31

How to reveal hidden characters in a string and remove them?

Friends. I compare 2 lines:
1st - the line taken from my DB.
2nd - line parsed from another site via curl.
In appearance, they are identical.
But when compared, they are not equal.

$nowtitle = mb_strtolower(stripslashes(trim($tt['title'])), 'cp1251');
$kptitle = mb_strtolower(stripslashes($kpdata['sertitle']), 'cp1251');

var_dump($nowtitle);
var_dump($kptitle);

Here's what var_dump() shows: Can
string(8) "лагерь х" string(13) "лагерь х"
you please tell me how to remove hidden characters from a string so that they compare correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question