我有以下代码:
$woo_options = get_option( 'woo_options' );
//print_r($woo_options);
$has_updated = false;
foreach ($options as $value) {
//print_r($value);
update_option( $value['id'], $_REQUEST[ $value['id'] ] );
$key = $value['id'];
$keyconf = $_REQUEST[ $value['id'] ];
**echo $woo_options[$key];**
if ( isset( $woo_options[$key] ) ) {
$woo_options[$key] = $keyconf;
$has_updated = true;
}
}
if ( $has_updated == true ) {
update_option( 'woo_options', $woo_options );
}
问题是如果我把echo $woo_options[$key]; 没有任何反应,并且使用echo $woo_options['woo_author']; 使用正确的引号,值会显示出来......我需要它来更新数组中的值。
这是我的“print_r($woo_options);”的一部分
Array ( [woo_alt_stylesheet] => [woo_logo] => [woo_texttitle] => [woo_font_site_title] => Array ( [size] => 40 [unit] => px [face] => Droid Serif [style] => 300 [颜色] => #ffffff ) [woo_google_analytics] => [woo_feed_url] => [woo_subscribe_email] => [woo_comments] => 发布 [woo_post_content] => 摘录 [woo_author] => 假...
注意:$key var 出现了:woo_alt_stylesheet, woo_logo, woo_texttitle...