I am working on a function that requires me to retrieve the contents of a web page and then check if certain text is present on this page. This is a backlink verification tool.
The problem is that the function works fine in most cases, but sometimes it puts the page in the absence of a link when the link is explicitly there. I tracked this to the point of visually comparing the lines in the output, and they only match the penalty, but using the == php operator tells me that they don't match.
Recognizing that this is probably some kind of encoding problem, I decided to see what happens if I use base64_encode () on them, so I could see if these produce different results between two lines (which seems to be exactly the same).
My suspicions were confirmed - using base64_encode in matching strings gave different strings from each. Problem Found! The problem is that I do not know how to solve it.
Is there a way to make these lines the same based on the output text (which matches), so when I compare them in php, do they match?
Peter source share