Answers for "include_once in php"

PHP
8

include and require in php

// Include a file, if it can't be found: continue.
<?php
include 'mainfile.php';
?>
  
// Alternatively: Require a file to be imported or quit if it can't be found
<?php
 require 'requiredfile.php';
?>
Posted by: Guest on April-25-2020
1

php include once inside a function?

//yes this works 
  function derp(){include_once(yourfile.php);}
Posted by: Guest on December-26-2020
1

require_once php

// Require_once is ignored if the required file has already been added by any of the include statements.
<?php
 require_once 'require_oncefile.php';
?>
Posted by: Guest on April-25-2020
1

php requuire once

require_once('var.php');
Posted by: Guest on March-27-2020

Browse Popular Code Answers by Language