0

This file is runing

my-site.com/includes/classes/build/cg.php

and it loads

my-site.com/data/data.json

with a such structure

$data = json_decode(file_get_contents("http://my-site.com/data/data.json"), true);

I want to load it with relevant path, how to do it?

Rast Wishes
  • 59
  • 1
  • 12

1 Answers1

0

After trying some combinations, realised this:

$data = json_decode(file_get_contents(__DIR__ ."/../../../data/data.json"), true);

or

$data = json_decode(file_get_contents("././././data/data.json"), true);
Rast Wishes
  • 59
  • 1
  • 12