the way of accessing constant inside the function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

the way of accessing constant inside the function

A constant which is created by define () cannot acceded inside a function using global keyword <?php define("m",40); function t() { global m; echo m; } t(); ?>

7th Oct 2017, 9:39 AM
Sanjeev Ravi
Sanjeev Ravi - avatar
1 Answer
+ 1
Always name constant in Uppercase :) here how to use constant inside function https://code.sololearn.com/wu6qqRDx632P/?ref=app
9th Oct 2017, 1:44 AM
Raziul Islam
Raziul Islam - avatar