src/LearnositySdk/Utils/Json.php
public static function getFromFile($path, $decode = false, $assoc = true)
    {
        if (is_readable($path)) {
            $json = utf8_encode(file_get_contents($path));
            if ($decode) {
                $json = json_decode($json, $assoc);
            }
            return $json;
        }
        return false;
    }
public static function getFromFile($path, $decode = false, $assoc = true)
    {
        if (is_readable($path)) {
            $json = utf8_encode(file_get_contents($path));
            if ($decode) {
                $json = json_decode($json, $assoc);
            }
            return $json;
        }
        return false;
    }
public static function getFromFile ( $ path , $ decode = false , $ assoc = true ) { if ( is_readable ( $ path ) ) { $ json = utf8_encode ( file_get_contents ( $ path ) ) ; if ( $ decode ) { $ json = json_decode ( $ json , $ assoc ) ; } return $ json ; } return false ; }
Trying to open a file and read json from there
@param  string  $path   path to the resource
@param  boolean $decode whether to decode
@param  boolean $assoc  whether to decode to associative array
@return mixed           json string, json object, json array or false on failure
Trying to open a file and read json from there