Talk:lib/weblib.php: Difference between revisions
From MoodleDocs
David Mudrak (talk | contribs) m (Text replacement - "</code>" to "</syntaxhighlight>") |
David Mudrak (talk | contribs) m (syntaxhighlight fix) |
||
Line 5: | Line 5: | ||
Code like | Code like | ||
< | <syntaxhighlight lang="php"> | ||
if (is_https()) { | if (is_https()) { | ||
$ssl = true; | $ssl = true; |
Latest revision as of 08:43, 15 July 2021
is_https
I switch the is_https example to a better bit of sample code.
Code like
if (is_https()) {
$ssl = true;
} else {
$ssl = false;
}
should never be used. It is equivalent to <code:php>
$ssl = is_https();
</syntaxhighlight>
However, in this case, the $ssl variable is used in exactly one place, so the code probably should not be using a local variable at all.--Tim Hunt (talk) 13:00, 6 October 2015 (AWST)