I have a problem with the error message "Trying to access array offset on the value of type int" I use PHP version 7.4, as I see on the web :
Array-style access of non-arrays
bool, int, float or resource as an array (such as $null["key"]) will now generate a notice.
Code is:
<?php
foreach($gdata_worksheets As $key => $value ){
//$key="1361298261";
?>
<option value="<?php echo strToHex($key); ?>"<?php echo $key == $gdata->worksheet_id ? ' selected="selected"' : ''?>><?php echo htmlentities($value, ENT_QUOTES, 'UTF-8');?></option>
function strToHex($string){
$hex = '';
for ($i=0; $i<strlen($string); $i++){
$ord = ord($string[$i]);
$hexCode = dechex($ord);
$hex .= substr('0'.$hexCode, -2);
}
return strToUpper($hex);
}
How solve this, any idea?
Regards