Would something like this work, or is this too simplistic?
<?php
$input = "Arte x ArTe";
$string = "arte_x_arte";
$compare = strtolower(str_replace(" ", "_", $input));
print "Input: $input<br/>";
print "String: $string<br/>";
print "Compare: $compare<br/><br/>";
if (strcmp($string, $compare) == 0) {
print 'We are the same!';
}
else {
print 'We are different!';
}