$$value['id'] = $value['std']; } else { $$value['id'] has one too many ‘$’s
$$value should be $value
other then that,,looks ok
Thanks,
Changed it to one $ but still the same error.
I did change it in both $$values, did you mean that?
So I tried:
<?php
global $options;
foreach ($options as $value) {
if (get_settings( $value[‘id’] ) === FALSE) { $value[‘id’] = $value[‘std’]; } else { $value[‘id’] = get_settings( $value[‘id’] ); }
}
instead of
<?php
global $options;
foreach ($options as $value) {
if (get_settings( $value[‘id’] ) === FALSE) { $$value[‘id’] = $value[‘std’]; } else { $$value[‘id’] = get_settings( $value[‘id’] ); }
}
The “Illegal string offset” warning when using $value[‘id’] means that the function is being passed a string instead of an array. (And then since a string offset is a number, ‘id’ is not suitable.)
So in theory the problem lies elsewhere, with the caller of the code not providing a correct parameter.
You might want to debug why the function is being given a string by examining the calling code, and find out what value it has by doing a var_dump($inputs); in the function. But for the quick solution you could change the line to:
if (is_array($value) && get_settings( $value[‘id’] === FALSE) {
Do it where the $value[‘id’] is, as this is a problem with php5.4, you could just revert back to 5.3 and it would be fine.