John Davidson

PHP 8.1.6, XAMPP -> Fatal error: Uncaught Error: Call to undefined function grapheme_strlen()

0 comments
Message:


PHP 8.1.6 does not find grapheme_strlen(). Any ideas why this happens?


Full error:


Fatal error: Uncaught Error: Call to undefined function grapheme_strlen() in C:\xampp\htdocs\api\v5\inc\classes\Validation.inc.php:90 Stack trace: #0 C:\xampp\htdocs\api\v5\tests\validation.php(14): Validation::fullname('ann') #1 {main} thrown in C:\xampp\htdocs\api\v5\inc\classes\Validation.inc.php on line 90

The function:


    /**
* Checks if a fullname is valid
*
* @param string $fullname
* @return FullnameValidation
*/
static function fullname(string $fullname): FullnameValidation
{
$min_length = 3;
$max_length = 30;

if (grapheme_strlen($fullname) >= $min_length) {
if (grapheme_strlen($fullname) <= $max_length) {
return FullnameValidation::ok;
} else {
return FullnameValidation::too_long;
}
} else {
return FullnameValidation::too_short;
}
}

Google gives me exactly zero results. Seems like i'm the only person who ever had this issue.



My Answer:
XAMPP is a free and open-source cross-platform web server solution stack package developed by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages.

PHP 8.1.6 is the latest version of the PHP programming language, which is widely used for web development. It comes with new features, improvements, and bug fixes to enhance the performance and security of web applications.

When using XAMPP, you can easily set up a local development environment on your computer to test and run PHP scripts and web applications. This allows you to develop and debug your projects before deploying them to a live server.

Overall, PHP 8.1.6 and XAMPP are powerful tools for web developers to create dynamic and interactive websites and applications.

Rate this post

5 of 5 based on 2393 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us