You need to make sure, that $meta
is actually of type array. The warning explicitly tells you, that $meta
seems to be a string
and not an array
Illegal string offset
^^^^^^
To avoid this error you may also check for the needed fields
for($i = 0; $i < 3; $i++) {
if ( !is_array($meta) || !array_key_exists('quote'. ($i+1), $meta) ){
continue;
}
// your code
}