if (!preg_match("/^[a-zA-Z '-´]*$/",$_POST['first_name'])) {
= '#' // REGEX DELIMITER
. '^' // AT START STRING
. '[' // START CHARACTER CLASS
. '\p{L}' // ANY LETTER
. " '-" // BLANK, APOSTROPHE, DASH
. ']' // ENDOF CHARACTER CLASS
. '*' // ONE OR MORE
. '$' // AT ENDOF STRING
. '#' // REGEX DELIMITER
. 'u' // FLAG: ALLOW UNICODE
. 'i' // FLAG: CASE-INSENSITIVE
allow for the ´being inserted into the database correctly or is it the below? It's a bit over my head... mb_internal_encoding('utf-8');
mb_regex_encoding('utf-8');
mb_http_output('utf-8');
if (!preg_match("#^[\p{L} '-]*$#ui",$_POST['first_name'])) {
$link = new mysqli($server_name, $db_username, $db_password, $db_dbname);
$link->set_charset("utf8mb4");
Open in new window