Constant value throughout the project

0

I'm using a PHP structured project

index.php

<?php      
  require 'vendor/autoload.php';  
  $dotenv = new Dotenv\Dotenv( "C:/env" ); 
  $dotenv->load();
  define('VARIAVEL', getenv( 'NOME_DA_VARIAVEL' ));
  echo VARIAVEL."<br>";
  echo "<a href='1.php'>a</a> ";    
?>
1.php

<?php
  echo VARIAVEL;
?>

I would like the constant variable defined in the index to serve the entire project

    
asked by anonymous 11.07.2018 / 16:38

0 answers