I got this error after copying code from a tutorial. It's deprecated and I tried resolving it:
Array and string offset access syntax with curly braces is no longer supported in.../app/Http/Helpers/helpers.php
My code copy:
if (!function_exists("pkcs5_unpad_e")) {
function pkcs5_unpad_e($text) {
$pad = ord($text{strlen($text) - 1});
if ($pad > strlen($text))
return false;
return substr($text, 0, -1 * $pad);
}
}
My edit: replace {....}
with [.....]
==> HTTP ERROR 500
if (!function_exists("pkcs5_unpad_e")) {
function pkcs5_unpad_e($text) {
$pad = ord($text[strlen($text) - 1]);
if ($pad > strlen($text))
return false;
return substr($text, 0, -1 * $pad);
}
}
I am using Ubuntu 20.04 DigitalOcean Cyberpanel server and PHP 8.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.