title: Return both array or nested array from API function
body: <p>I am pulling an API into a WordPress site. I spoke with the company that we are pulling it from and they mentioned that for a single result it sends an array but more than one result is sent as a nested array. It wasn't this way before so this is the code that I was previously using. Is it possible to return a result for both types? I apologize in advance, my knowledge of API development is limited.</p>
  <pre><code>function get_jazzhr_jobs()
  {
      $options = wp_load_alloptions();
  
      if (isset($options['jazz_hr_api'])) {
          $curl = curl_init();
          curl_setopt($curl, CURLOPT_URL, &quot;https://api.resumatorapi.com/v1/jobs/status/open?apikey={$options['jazz_hr_api']}&quot;);
          curl_setopt($curl, CURLOPT_HTTPHEADER, [
              'Content-Type: application/json',
          ]);
          curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
          $result = curl_exec($curl);
          $jobs   = json_decode($result);
  
          return $jobs;
      } else {
          return false;
      }
  }
  </code></pre>
  <p>EDIT</p>
  <p>If there is only one posting in JazzHR there will be no result shown but if there are 2 postings then both will be returned and show in the system. The $jobs is then used in the WordPress template to display the information that is received from the API. The main issue is when there is only 1 posting the array is built, but the $jobs are not populated as it has been explained to me that this snippet is working to only populate a nested array.</p>