I want to do a check if a name already exists in an array.
I have an issue with a name which contains accented chars.
Below is the code is use and when filling in the (french) name Charlène Rodriês
and the (german) name Jürgen Günter
; it outputs: NOT exists.
How can i catch these names which contain accented characters?
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['bioname'])) {
$bioname = trim(htmlentities($_POST['bioname']));
$array = array('John Doe','Bill Cleve','Charlène Rodriês','мария преснякова','Jürgen Günter');
if (in_array($bioname_raw, $array)) { // if bioname already exists
echo '<div">'.$bioname.' ALREADY exists!</div>';
}
else {
echo '<div">'.$bioname.' NOT exists!</div>';
}
}
}
?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">
<input class="form-control" name="bioname" type="text" placeholder="AUTHORNAME">
<button type="submit" id="cf-submit" name="submit" class="btn btn-primary w-100">POST</button>
</form>