0
// CS50 Library
require("../vendor/library50-php-5/CS50/CS50.php");
CS50::init(__DIR__ . "/../config.json");

How does CS50::init(directory) work?

2
  • Do you have a more specific question? The init function is very straightforward and very well documented. Commented Dec 13, 2016 at 13:03
  • mind explaining?why is :: used? Commented Dec 13, 2016 at 14:23

1 Answer 1

2

To answer the specific question from your comment "why is :: used?"

From the config section of the spec

(That :: syntax just means that init is "inside of" an "object" called CS50. An object in PHP, meanwhile, is similar in spirit to, but more featureful then, a struct in C.

The CS50 class is defined around line 70 of CS50.php. You'll find more info on php classes and objects in the php doc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .