How to make array in JSON ? : Here, I want to a make array of requests in the below code so, I want to store multiple images in that requests until the for loops terminate. How could I do that ?



> Blockquote
     
     for($i = 0; $i < 5; $i++) 
     {         
       $imageName = __DIR__.'/uploads/'.$i.time().'.png';
       $data= file_get_contents($imageName);
       $base64 = base64_encode($data);
       $type = 'TEXT_DETECTION';
       $request_json[] = '
       {
           "requests": [
             {
                "image": {
                    "content":"' . $base64 . '"
              },
                "features": [
                   {
                     "type": "' . $type . '",
                       "maxResults": 200
                    }
                 ]
              }
                ]
            }';
     }
 
Please Help me.
Thanks in Advance.