PHP Programing language

adplus-dvertising
How Can Define Constant in Function
Previous Home Next
<html>
<head>
<title>	define constant ina function</title>
</head>
<body>
<?php

define('CO1', 1);

function MyTest() {
  define('CO2', 2);
}

MyTest();
echo "CO1 = " . CO1 . " and CO2 = " . CO2 . "\n";
?>
  
</body>
</html>

Output:

Previous Home Next