I have this below code from old theme file. When migrating this to PHP 8, exactly at this line ($$value[‘id’] = get_option( $value[‘id’] ); }) it throws an error – [error] 198034#198034: *334 FastCGI sent in stderr: “ng: Array to string conversion
Any solution?
global $options, $value, $shortname;
foreach ($options as $value) {
if (isset($value['id'])) {
if ( get_option( $value['id'] ) === FALSE) {
if (array_key_exists('std', $value)) {
update_option( $value['id'], $value['std'] );
$$value['id'] = $value['std'];
}
} else {
$$value['id'] = get_option( $value['id'] ); }
}
}