SarkariResultess QA Bank

PHP cookie read कैसे करते हैं? इसका सही PHP syntax क्या है?

Other 0 Views Verified
PHP cookie read कैसे करते हैं? इसका सही PHP syntax क्या है? सही विकल्प चुनें और code/solution को समझें।
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified

$theme = $_COOKIE->theme;

$theme = $_COOKIE->theme;
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified Correct Answer

$theme = $_COOKIE['theme'] ?? 'light';

$theme = $_COOKIE['theme'] ?? 'light';
Additional Explanation
$_COOKIE client cookies का array है।
Verified

$theme = cookie('theme');

$theme = cookie('theme');
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

$theme = $COOKIE['theme'];

$theme = $COOKIE['theme'];
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।