I took a couse by sololearn(ios app) on PHP now ive done a little studying and i feel like i have this right but i wanna make sure this is how u create a config PHP: $config = $this->config = new config("config.yml"); And to get a config PHP: $this->config->getConfig("config.yml"); Please correct me if im wrong
Incorrect. Please refer to JoinCommands and look at the code, I think it'd be simple enough for a beginner to understand. It should be $config = $this->getConfig(), not $config = $this->config = $this->getConfig(). For the second one, it should just be $this->getConfig() and not $this->config->getConfig("config.yml").
Okay So to create a config named config.yml all i have to do is PHP: $this->saveDefaultConfig(); And to get data from the config U just do PHP: $this->getConfig->get("key") === value; Also is it neccesary to user PHP: === ? Can u just use PHP: == just curious because using 3 feels like an extremity to me i just prefer to say equal to not identical to
Yes, yes(depending on circumstances), no, and sure, why not. Just look here: http://php.net/manual/en/language.operators.comparison.php
I get how === and == work but i dont get what the difference is like where would i need one instead of the other?
It is very different. If you have 2 strings (Ex: "#Roasted" and "#Roasted") using either is ok. PHP: if("#Roasted" == "#Roasted")if("#Roasted" === "#Roasted") But if you compare an integer and a string (Ex: 1 and "1") == would return true but === would return false. Why? == means Equal and === means Identical. When you use equal, maybe they are different types but PHP would do something called Type Juggling. Identical: DID YOU PASS 2nd GRADE MATH???