Nishant
Nishant

Reputation: 19

How do I get the values from an array?

I am getting following output-:

Array
(
    [read_only] => 
    [revision] => 128
    [bytes] => 0
    [thumb_exists] => 
    [rev] => 80527cbf3f
    [modified] => Tue, 03 Jan 2017 05:09:35 +0000
    [size] => 0 bytes
    [path] => /Unfiled Documents
    [is_dir] => 1
    [modifier] => 
    [root] => dropbox
    [icon] => folder
)
1

Script :

echo '<pre>', print_r($client->getMetadata('/Unfiled Documents')), '</pre>';

How do I access the files and folder inside the "Unfilled Documents".

Upvotes: 0

Views: 44

Answers (2)

Nishant
Nishant

Reputation: 19

I access the values now:

  $query = 'UR-000001';
    $path = '/Unfiled Documents';
    $filenames = $client->searchFileNames($path, $query, 10, false);
   echo '<pre>', print_r($filenames[0]), '</pre>';

And get the following ouput :

Array
   (
    [rev] => 83527cbf3f
    [thumb_exists] => 
    [path] => /Unfiled Documents/UR-000001 – PLAN – 123432.pdf.txt
    [is_dir] => 
    [client_mtime] => Mon, 02 Jan 2017 13:20:19 +0000
    [icon] => page_white_text
    [read_only] => 
    [modifier] => 
    [bytes] => 0
    [modified] => Tue, 03 Jan 2017 06:54:54 +0000
    [size] => 0 bytes
    [root] => dropbox
    [mime_type] => text/plain
    [revision] => 131
 )
 1

Upvotes: 1

Ashish Patel
Ashish Patel

Reputation: 1031

First you have to get folder path like: Please try following solution might work

$path  = $client->getMetadata['path'];
$files = scandir($path);

print_r($files);

Upvotes: 1

Related Questions