Ecommerce Shopify WordPress Discussion

Php get values from array and subarray till n

I am working on getting all the settings log to make it in readable form. Currently my data is shown as: -- System Information -- site_url(): http://analytify-github.local home_url(): http://analytify-github.local WordPress: 6.4.2 Web Server: nginx/1.16.0 PHP: 8.2.10 MySQL: 8.0.16 ext/mysqli: yes WP Memory Limit: 40M Blocked External HTTP Requests: None WP Locale: en_US DB Charset: utf8 Debug Mode: Yes WP Max Upload Size: 300 MB PHP Time Limit: 1200 PHP Error Log: C:\Users\WPB\Local Sites\analytify-github\app\public/wp-content/debug.log fsockopen: Enabled OpenSSL: OpenSSL 3.0.8 7 Feb 2023 cURL: Enabled (7.85.0 OpenSSL/3.0.8) Active Theme Name: Travel Boost Active Theme Folder: travel-boost -- Active Plugins -- Analytify Dashboard Widget (v5.2.0) by Analytify Easy Digital Downloads (v3.2.6) by Easy Digital Downloads Google Listings and Ads (v2.5.14) by WooCommerce WooCommerce (v8.4.0) by Automattic Analytify Authors Tracking (v5.1.0) by Analytify Analytify UTM Campaigns Tracking (v5.1.0) by Analytify Analytify Easy Digital Downloads (v5.1.0) by Analytify Analytify Email Notifications (v5.1.0) by Analytify Analytify Forms (v5.1.0) by Analytify Analytify Goals (v5.0.2) by Analytify Analytify Pro (v5.2.0) by Analytify Analytify WooCommerce (v5.1.1) by Analytify Analytify Dashboard (v5.2.1) by Analytify -- Active Modules -- Events Tracking Custom Dimensions Google Optimize Google Ads Tracking -- Last Authenticated -- Tuesday 9th January 2024 12:09:27 PMUTC -- Analytify Profile Setting -- install_ga_code: on exclude_users_tracking: Array ( [0] => administrator ) profile_for_posts: ga4:276784139 profile_for_dashboard: ga4:276784139 hide_profiles_list: off -- Analytify Front Setting -- disable_front_end: on show_analytics_roles_front_end: Array ( [0] => administrator [1] => editor ) show_analytics_post_types_front_end: Array ( [0] => post [1] => page ) show_panels_front_end: Array ( [0] => show-overall-front [1] => show-country-front [2] => show-keywords-front [3] => show-social-front [4] => show-browser-front [5] => show-referrer-front [6] => show-mobile-front [7] => show-os-front [8] => show-city-front ) -- Analytify Admin Setting -- enable_back_end: on show_analytics_roles_back_end: Array ( [0] => administrator [1] => editor ) show_analytics_post_types_back_end: Array ( [0] => post [1] => page ) show_panels_back_end: Array ( [0] => show-overall-dashboard [1] => show-social-dashboard [2] => show-geographic-dashboard [3] => show-system-stats [4] => show-keywords-dashboard [5] => show-referrer-dashboard ) -- Analytify Dashboard Setting -- show_analytics_panels_dashboard: Array ( [0] => show-real-time [1] => show-compare-stats [2] => show-overall-dashboard [3] => show-top-pages-dashboard [4] => show-geographic-dashboard [5] => show-system-stats [6] => show-keywords-dashboard [7] => show-social-dashboard [8] => show-referrer-dashboard [9] => show-page-stats-dashboard ) show_analytics_roles_dashboard: Array ( [0] => administrator ) -- Events Tracking Setting -- file_extension: zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar* affiliate_link_path: Array ( [0] => Array ( [path] => https://wpbrigade.com/?edd_action=add_to_cart&download_id=1835&edd_options%5Bprice_id%5D=4&_gl=1*bzfdf6*_ga*ODA1Mzc5NjgyLjE3MDM2ODA1MzM.*_ga_YCW7CRBRMF*MTcwNDM2NjA2Ny4xMi4wLjE3MDQzNjYxMTkuOC4wLjA. [label] => test ) ) enhanced_link_attribution: on anchor_tracking: on -- Custom Dimensions Setting -- analytiy_custom_dimensions: Array ( [0] => Array ( [type] => author ) [1] => Array ( [type] => published_at ) ) -- Google Optimize Setting -- -- Forms Tracking Setting -- custom_form: on track_cf7: off track_wpforms: off track_ninjaforms: off track_gravityforms: off track_formidable: off track_fluentforms: off -- Analytify Email Setting -- disable_email_reports: off analytiy_from_name: Bilal analytiy_from_email: ahmed.wpbrigade@gmail.com analytify_email_user_email: Array ( [0] => Array ( [name] => Ahmed [email] => ahmed.wpbrigade@gmail.com ) ) analytif_email_cron_time: Array ( [week] => Monday [month] => 1 ) analytify_email_subject: TEST analytify_email_stats: Array ( [0] => show-overall-general [1] => show-top-pages [2] => show-geographics [3] => show-system [4] => show-keywords [5] => show-social [6] => show-whats-happen ) analytify_email_logo: analytiy_mail_text: TEST analytiy_mail_text_additional: We hope your weekly Analytics summaries encourage the efforts you are putting in your business. But if you no longer wish to receive Analytify Insights emails, you may change your preferences from plugin settings. analytify_go_to_dashboard: off -- Analytify Advance Setting -- google_analytics_version: ga4 gtag_tracking_mode: gtag ga4_web_data_stream: G-PF9VK8TRF6 measurement_protocol_secret: F95aJ6GZQUeGaLvLHQpqRw user_advanced_keys: off client_id: 707435375568-9lria1uirhitcit2bhfg0rgbi19smjhg.apps.googleusercontent.com client_secret: Hidden redirect_uri: locally_host_analytics: off anonymize_ip: off force_ssl: off track_user_id: off depth_percentage: off demographic_interest_tracking: off 404_page_track: off javascript_error_track: off ajax_error_track: off linker_cross_domain_tracking: off linked_domain: uninstall_analytify_settings: off custom_js_code: custom_css_code: woo_email_tracking: off I want to remove all the arrays and show them in a readable text form. My code for printing arrays is: public static function print_settings_array( $settings_array ) { if ( is_array( $settings_array ) ) { foreach ( $settings_array as $key => $value ) { if ( is_array( $value ) ) { echo "$key:\r\n"; echo print_r( $value, true ) . "\r\n"; } else { echo "$key: $value\r\n"; } } } } I tried the following way to get the thing done but I think it is not optimized and might give error at some point. The code I tried is public static function print_settings_array( $settings_array ) { if ( is_array( $settings_array ) ) { foreach ( $settings_array as $key => $settings ) { if ( is_array( $settings ) ) { echo "$key:\r\n"; foreach ( $settings as $key => $setting ) { if (!is_numeric($key)) { echo "$key:$setting\r\n"; } if (is_array( $setting ) ) { foreach ($setting as $key => $sub_settings) { echo "$key: $sub_settings\r\n"; } } else { echo "$setting\r\n"; } } } else { echo "$key: $settings\r\n"; } } } } Now I want a direction on is it ok ? Or from which point I can set it to make it more optimize.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.