Have you tried doing funky things like producing a third string as a mix of the two?I used both == and ===.
$frankenString=$hardCodedUrl;
$frankenString[3]=$otherUrl[3];
//send off frankenstring
Could see if it works for any swapped character.
Also just double checking, have you been using == not ===? Maybe the user entered string isn't a string.
The latter evaluates as true, the former returns a 1.