-1

how to access each file name...

 {"Appointments":
    [
        {
            "file_name":"eeea4a560492004c5c14f9414e88c32c.jpg", 
            "file_type":"image\/jpeg", 
            "file_path":"C:\/inetpub\/wwwroot\/nautSearch\/server\/uploadedfiles\/files\/", 
            "orig_name":"a46cf6866df6f358bece629ef472ac69.jpg", 
            "file_ext":".jpg", 
            "file_size":418.17, 
            "is_image":true, 
            "image_width":2560, 
            "image_height":1440, 
            "image_type":"jpeg", 
            "image_size_str":"width=\"2560\" height=\"1440\""

        }, 
        {
            "file_name":"c08ff85a44e0f86ab48ec709e6ba1b4a.jpg", 
            "file_type":"image\/jpeg", 
            "file_path":"C:\/inetpub\/wwwroot\/nautSearch\/server\/uploadedfiles\/files\/", 
            "file_ext":".jpg", 
            "file_size":27.38, 
            "is_image":true, 
            "image_width":479, 
            "image_height":403, 
            "image_type":"jpeg", 
            "image_size_str":"width=\"479\" height=\"403\""

        }, 
        {
            "file_name":"4536acd0479c6c5dee3b1f546ed8d328.jpg", 
            "file_type":"image\/jpeg", 
            "file_path":"C:\/inetpub\/wwwroot\/nautSearch\/server\/uploadedfiles\/files\/", 
            "file_ext":".jpg", 
            "file_size":27.38, 
            "is_image":true,
            "image_width":479, 
            "image_height":403, 
            "image_type":"jpeg", 
            "image_size_str":"width=\"479\" height=\"403\""

        }
    ]
}
M. Wiśnicki
  • 6,094
  • 3
  • 23
  • 28
Dinesh
  • 17
  • 7
  • Welcome to SO! Please elaborate a bit about what this data structure is. Did you read it from a file? A web service? Is it already parsed into an object or array? What did you try? By access, do you mean retrieving the names of the files or reading the files? – Jelle Nov 24 '16 at 08:24

1 Answers1

0

What you gave is a json string. First you must decode it and loop over the appointments to use the file names:

$result = json_decode($yourJsonString);

foreach ($result->Appointments as $appointment) {
    echo $appointment->file_name;
}
Mihai Matei
  • 24,166
  • 5
  • 32
  • 50