PHP Case Sensitivity Explain in Sinhala - Lesson 04
මොකක්ද මේ PHP Case Sensitivity කියන්නේ?
- Case Sensitivity කියන්නේ lowercase (Simple) සහ uppercase (Capital) letters program එකට වෙන වෙනම අදුනගන්න පුලුවන්ද කියන එකටයි.
- ඒ කියන්නේ ඔයාගේ programming language එක case sensitive නම් ඔයා simple capital මාරු කරලා coding කලොත් errors එන්න පුළුවන්.
- PHP වලදී key words ඇරෙන්න අනිත් classes, variables, functions, and user-defined functions Case Sensitive.
- ඒ කියන්නේ PHP වලදී simple capital මාරු කරලා type කලාට ගැටලුවක් නැත්තේ key words විතරයි.
(e.g.key words if
, else
, while
, echo
, etc.)
Example 01
<!DOCTYPE html> <html> <body> <?php ECHO "Hello World!<br>"; echo "Hello World!<br>"; EcHo "Hello World!<br>"; ?> </body> </html>
මේ example එකේ echo කියන keyword එක එක එක විදියට දාල තියෙනවා. ඔයාල මේක රන් කරලා බලන්න වෙනසක් තියෙනවද කියල.
Example 02
<!DOCTYPE html> <html> <body> <?php $color = "red"; echo "My car is " . $color . "<br>"; echo "My house is " . $COLOR . "<br>"; echo "My cap is " . $coLOR . "<br>"; ?> </body> </html>
බලන්න මේ example එක. මේකේ $color කියල variable එකක් හදල තියෙනවා. ($color = "red";
)
පහලින් තියෙන lines වලින් ඒ variable එක use කරලා තියෙනවා එක එක ආකාරයට. ( $color
, $COLOR
, සහ $coLOR
)
නමුත් php වලදී variables case sensitive නිසා මේවා එක variable විදියට නෙමෙයි variables තුනක් විදියට තමයි ගන්නේ.
මේකත් run කරලා බලන්න මොකක්ද result එක කියල.
php tutorial sinhala
Tagged:
1
Debug Trace
Info | Could not find file 'oauth2.css' in folder 'oauth2'. |
Notice |
Trying to access array offset on value of type bool #0 /home/xtreabfi/kuppiya/cache/Smarty/compile/vanilla^8d148c5e1b13e8d27851611d20a380b18401257f_0.file.default.master.tpl.php(45): gdn_ErrorHandler(8, 'Trying to acces...', '/home/xtreabfi/...', 45, Array) #1 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6594354daaee31_19788427(Object(Smarty_Internal_Template)) #2 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #3 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #4 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1) #5 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, 'vanilla', NULL, 1) #6 /home/xtreabfi/kuppiya/library/core/class.smarty.php(146): Smarty_Internal_TemplateBase->display('/home/xtreabfi/...', NULL, 'vanilla') #7 /home/xtreabfi/kuppiya/library/core/class.controller.php(2232): Gdn_Smarty->render('/home/xtreabfi/...', Object(DiscussionController)) #8 /home/xtreabfi/kuppiya/library/core/class.controller.php(1595): Gdn_Controller->renderMaster() #9 /home/xtreabfi/kuppiya/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #10 /home/xtreabfi/kuppiya/applications/vanilla/controllers/class.discussioncontroller.php(336): Gdn_Pluggable->__call('render', Array) #11 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(933): DiscussionController->index('68', 'php-case-sensit...', '') #12 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(335): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #13 /home/xtreabfi/kuppiya/index.php(29): Gdn_Dispatcher->dispatch() #14 {main} |
Notice |
Trying to access array offset on value of type bool #0 /home/xtreabfi/kuppiya/cache/Smarty/compile/vanilla^8d148c5e1b13e8d27851611d20a380b18401257f_0.file.default.master.tpl.php(125): gdn_ErrorHandler(8, 'Trying to acces...', '/home/xtreabfi/...', 125, Array) #1 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6594354daaee31_19788427(Object(Smarty_Internal_Template)) #2 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #3 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #4 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1) #5 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, 'vanilla', NULL, 1) #6 /home/xtreabfi/kuppiya/library/core/class.smarty.php(146): Smarty_Internal_TemplateBase->display('/home/xtreabfi/...', NULL, 'vanilla') #7 /home/xtreabfi/kuppiya/library/core/class.controller.php(2232): Gdn_Smarty->render('/home/xtreabfi/...', Object(DiscussionController)) #8 /home/xtreabfi/kuppiya/library/core/class.controller.php(1595): Gdn_Controller->renderMaster() #9 /home/xtreabfi/kuppiya/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #10 /home/xtreabfi/kuppiya/applications/vanilla/controllers/class.discussioncontroller.php(336): Gdn_Pluggable->__call('render', Array) #11 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(933): DiscussionController->index('68', 'php-case-sensit...', '') #12 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(335): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #13 /home/xtreabfi/kuppiya/index.php(29): Gdn_Dispatcher->dispatch() #14 {main} |
Notice |
Trying to access array offset on value of type bool #0 /home/xtreabfi/kuppiya/cache/Smarty/compile/vanilla^8d148c5e1b13e8d27851611d20a380b18401257f_0.file.default.master.tpl.php(219): gdn_ErrorHandler(8, 'Trying to acces...', '/home/xtreabfi/...', 219, Array) #1 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6594354daaee31_19788427(Object(Smarty_Internal_Template)) #2 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #3 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #4 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1) #5 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, 'vanilla', NULL, 1) #6 /home/xtreabfi/kuppiya/library/core/class.smarty.php(146): Smarty_Internal_TemplateBase->display('/home/xtreabfi/...', NULL, 'vanilla') #7 /home/xtreabfi/kuppiya/library/core/class.controller.php(2232): Gdn_Smarty->render('/home/xtreabfi/...', Object(DiscussionController)) #8 /home/xtreabfi/kuppiya/library/core/class.controller.php(1595): Gdn_Controller->renderMaster() #9 /home/xtreabfi/kuppiya/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #10 /home/xtreabfi/kuppiya/applications/vanilla/controllers/class.discussioncontroller.php(336): Gdn_Pluggable->__call('render', Array) #11 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(933): DiscussionController->index('68', 'php-case-sensit...', '') #12 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(335): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #13 /home/xtreabfi/kuppiya/index.php(29): Gdn_Dispatcher->dispatch() #14 {main} |
Notice |
Trying to access array offset on value of type bool #0 /home/xtreabfi/kuppiya/cache/Smarty/compile/vanilla^8d148c5e1b13e8d27851611d20a380b18401257f_0.file.default.master.tpl.php(235): gdn_ErrorHandler(8, 'Trying to acces...', '/home/xtreabfi/...', 235, Array) #1 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6594354daaee31_19788427(Object(Smarty_Internal_Template)) #2 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #3 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #4 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1) #5 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, 'vanilla', NULL, 1) #6 /home/xtreabfi/kuppiya/library/core/class.smarty.php(146): Smarty_Internal_TemplateBase->display('/home/xtreabfi/...', NULL, 'vanilla') #7 /home/xtreabfi/kuppiya/library/core/class.controller.php(2232): Gdn_Smarty->render('/home/xtreabfi/...', Object(DiscussionController)) #8 /home/xtreabfi/kuppiya/library/core/class.controller.php(1595): Gdn_Controller->renderMaster() #9 /home/xtreabfi/kuppiya/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #10 /home/xtreabfi/kuppiya/applications/vanilla/controllers/class.discussioncontroller.php(336): Gdn_Pluggable->__call('render', Array) #11 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(933): DiscussionController->index('68', 'php-case-sensit...', '') #12 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(335): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #13 /home/xtreabfi/kuppiya/index.php(29): Gdn_Dispatcher->dispatch() #14 {main} |
Notice |
Undefined index: internal #0 /home/xtreabfi/kuppiya/library/core/class.router.php(70): gdn_ErrorHandler(8, 'Undefined index...', '/home/xtreabfi/...', 70, Array) #1 /home/xtreabfi/kuppiya/library/core/class.theme.php(92): Gdn_Router->getRoute('DefaultControll...') #2 /home/xtreabfi/kuppiya/library/SmartyPlugins/function.breadcrumbs.php(24): Gdn_Theme::breadcrumbs(Array, true, Array) #3 /home/xtreabfi/kuppiya/cache/Smarty/compile/vanilla^8d148c5e1b13e8d27851611d20a380b18401257f_0.file.default.master.tpl.php(332): smarty_function_breadcrumbs(Array, Object(Smarty_Internal_Template)) #4 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6594354daaee31_19788427(Object(Smarty_Internal_Template)) #5 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #6 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #7 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1) #8 /home/xtreabfi/kuppiya/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, 'vanilla', NULL, 1) #9 /home/xtreabfi/kuppiya/library/core/class.smarty.php(146): Smarty_Internal_TemplateBase->display('/home/xtreabfi/...', NULL, 'vanilla') #10 /home/xtreabfi/kuppiya/library/core/class.controller.php(2232): Gdn_Smarty->render('/home/xtreabfi/...', Object(DiscussionController)) #11 /home/xtreabfi/kuppiya/library/core/class.controller.php(1595): Gdn_Controller->renderMaster() #12 /home/xtreabfi/kuppiya/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #13 /home/xtreabfi/kuppiya/applications/vanilla/controllers/class.discussioncontroller.php(336): Gdn_Pluggable->__call('render', Array) #14 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(933): DiscussionController->index('68', 'php-case-sensit...', '') #15 /home/xtreabfi/kuppiya/library/core/class.dispatcher.php(335): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #16 /home/xtreabfi/kuppiya/index.php(29): Gdn_Dispatcher->dispatch() #17 {main} |