CarlEOgden
1 week ago
143
6
Laravel

Accessing .tag in PHP variable

Posted 1 week ago by CarlEOgden

Hi

I've got the following routine and I would like to know if the .tag = "folder" or not!

Any help on me fixing this:

                    $file = new \stdClass();

                    $file->id   = $dropbox_file->id;
                    $file->name = $dropbox_file->name;
                    $file->size = \StringHelpers::formatBytes($dropbox_file->size);
                    #$file->tag = $dropbox_file['.tag'];
                    if ($dropbox_file[".tag"] == 'folder') {
                        $file->tag = 'folder';
                    }else {
                        $file->tag = 'file';
                    }

I cannot get $dropbox_file['.tag'] or $dropbox_file[".tag"]

Thanks in advance Carl.

Please sign in or create an account to participate in this conversation.