get_defined_constants


php128 apg

RETURNS an associative array with the names of all the CONSTANTS and their values.





This function returns the names and values of all the CONSTANTS currently defined.

This includes those created by extensions as well as those created with the define function.



<?php

arr get_defined_constants 
bool $categorize false 


where,

$categorize To control the dimension of the returned ARRAY
  
?>

 $categorize 


To control the dimension of the returned ARRAY.

The $categorize cause this function to return a multidimensional array with categories in the keys of the first dimension and CONSTANTS and their values in the second dimension.



  1 EXERCISE   

<?php

$arr01 
get_defined_constants();

echo 
'<pre>';
print_r($arr01);
echo 
'</pre>';

?>

  2 EXERCISE   

<?php

$arr02 
get_defined_constants(TRUE);

echo 
'<pre>';
print_r($arr02);
echo 
'</pre>';

?>