private function getJsonData($filePath, $return_as_string = FALSE) {
    $json = file_get_contents($filePath);
    if ($json === FALSE) {
      return FALSE; // Cannot read from file.
    }
    $jsonData = json_decode($json, TRUE);
    if ($jsonData === NULL) {
      return FALSE; // JSON cannot be decoded or the recursion limit has been reached.
    }
    return $return_as_string ? $json : $jsonData;
  }
private function getJsonData($filePath, $return_as_string = FALSE) {
    $json = file_get_contents($filePath);
    if ($json === FALSE) {
      return FALSE; // Cannot read from file.
    }
    $jsonData = json_decode($json, TRUE);
    if ($jsonData === NULL) {
      return FALSE; // JSON cannot be decoded or the recursion limit has been reached.
    }
    return $return_as_string ? $json : $jsonData;
  }
private function getJsonData ( $ filePath , $ return_as_string = FALSE ) { $ json = file_get_contents ( $ filePath ) ; if ( $ json === FALSE ) { return FALSE ; // Cannot read from file. } $ jsonData = json_decode ( $ json , TRUE ) ; if ( $ jsonData === NULL ) { return FALSE ; // JSON cannot be decoded or the recursion limit has been reached. } return $ return_as_string ? $ json : $ jsonData ; }
Fetch json data from file

@param string $filePath
Path to the file holding the json string
@param boolean $return_as_string
If true the json data will be decoded in order to validate it, but will be
returned as string
@return mixed
FALSE if the file can't be read or the contents can't be decoded
string if the $return as string parameter is set
array otherwise
Fetch json data from file