require_once php
snippet in php

php requuire once

user2665

require_once('var.php');

require_once php

user6439

// Require_once is ignored if the required file has already been added by any of the include statements.
<?php
 require_once 'require_oncefile.php';
?>

require_once in php

user4686

// name of file is index.php 
  
<?php 
  
require_once('header.inc.php'); 
  
require_once('header.inc.php'); 
  
?> 

require_once different on server

user749

define('__ROOT__', dirname(dirname(__FILE__))); //call define untill you get to the root directory
require_once (__ROOT__."/Path/To/File.php"); //append __ROOT__ to the string