How to Print multidimension array in for loop ?

In this tutorial i’m going to share how to print multidimension array in for loop.

1st step got to your controller and put below code

public function getsocialurl($id){
        log::info('abhi in kiye hai be');
        log::info('trees in kiye hai be'.$id);
        $wizard_data = WebAcces::where('slug_id', $id)->get();
        log::info('wizard_data in kiye hai be'.$wizard_data);
        $response = [
            'success' => true,
            'data' => $wizard_data,
            'message' => 'gettings retrieved successfully.',
        return response()->json($response, 200);

Next go to blade page and put below code

                    type: "get",
                    data: {},
                    url: "{{ url('/api/v1/j/webaccess/wizards') }}/" + id,
                    headers: {
                        "Authorization": "Bearer " + localStorage.getItem('a_u_a_b_t')
                    success: function(response) {
                        var arrayLength =;
                        console.log("Number of items in the array:", arrayLength);
                        // Loop through the array and print admin_id where it exists
                        for (var i = 0; i < arrayLength; i++) {
                            var item =[i];
                            // var item =[i];
                            if (item.facebooks) {
                                console.log("admin_id me hai be:", item.facebooks);
                            if (item.slideshare) {
                                console.log("slideshare me hai be:", item.slideshare);
                            if ( {
                                console.log("youtube me hai be:",;
                            if (item.tiktok) {
                                console.log("tiktok me hai be:", item.tiktok);

                        // Access the data property of the response
                        var wizardData =;
                        if (wizardData.length > 1) {
                            var facebooksData = wizardData[0].facebooks;
                            var tiktok_value = wizardData[0].tiktok;
                            var facebooksData = wizardData[0].facebooks;
                            var slideshare_value = wizardData[0].slideshare;
                            var youtube_value = wizardData[0].youtube;
                            var dailymotion_value = wizardData[0].dailymotion;
                            var twitter_value = wizardData[0].twitter;
                            var linkedin_value = wizardData[0].linkedin;
                            var instagram_value = wizardData[0].instagram;
                            var tumblr_value = wizardData[0].tumblr;
                            var wordpress_value = wizardData[0].wordpress;
                            var pinterest_value = wizardData[0].pinterest;
                            var reddit_value = wizardData[0].reddit;
                            var plurk_value = wizardData[0].plurk;
                            var debugschool_value = wizardData[0].debugschool;
                            var blogger_value = wizardData[0].blogger;
                            var medium_value = wizardData[0].medium;
                            var quora_value = wizardData[0].quora;
                            var professnow_value = wizardData[0].professnow;
                            var github_value = wizardData[0].github;
                            var hubpages_value = wizardData[0].hubpages;
                            var gurukulgalaxy_value = wizardData[0].gurukulgalaxy;
                            var mymedicplus_value = wizardData[0].mymedicplus;
                            var holidaylandmark_value = wizardData[0].holidaylandmark;
                            var facebook_page_value = wizardData[0].facebook_page;
                            // Display the facebooks data or perform other actions
                        } else {
                            console.error('No data found in the response.');
                    error: function(error) {
                        console.error('Error retrieving data:', error);

Now output coming successfully .

Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.

Related Posts

How to Crawl any website Meta Title and Meta Description in Laravel ?

1st step install below package. Next to create Controller First go to route and put below code Next go to controller and put below code Next go…

SQLSTATE[HY000] [2002] No such file or directory (Connection: mysql, SQL: insert into `oauth_clients` (`user_id`, `name`, `secret`

In this tutorial i’m going to solve the error SQLSTATE[HY000] [2002] No such file or directory (Connection: mysql, SQL: insert into oauth_clients (user_id, name, secret Error :-…

Top 20 Laravel Interview Question in 2024

In this tutorial im going share interview experience For laravel developer. A list of top frequently asked Laravel Interview Questions and answers are given below. Q #1) What is…

How to Get Google Analytics API key ?

In this tutorial we’re going to share how to get the google Analytics API key. I have shared in very easy way. First go enable Google analytics…

Youtube Subscriber Count in ReactJs

In this tutorial i’m going to learn how to count YouTube Subsribers count, views count as well, as define below. In order to install your app, first…

How to Disable Laravel’s Eloquent timestamps in laravel ?

In this tutorial we’re going to share how to disable the automatic created_at and updated_at timestamps in Laravel’s Eloquent models, along with explanations of different scenarios: 1st…

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x