Skip to content

Instantly share code, notes, and snippets.

@YurePereira
Created February 26, 2017 17:15
Show Gist options
  • Select an option

  • Save YurePereira/c204d311c87fddb7c6726dc63d51a67c to your computer and use it in GitHub Desktop.

Select an option

Save YurePereira/c204d311c87fddb7c6726dc63d51a67c to your computer and use it in GitHub Desktop.
Usando include_once e require_once no PHP.
<?php
//Caminhos dos arquivos a serem incluídos.
$path1 = '<path>/filename_1.php';
$path2 = '<path>/filename_2.php';
//Usando a função include_once:
include_once($path1);
//O arquivo no $path1 não será incluído, pois ele já foi.
include_once($path1);
//Usando a função include_once:
require_once($path2);
//O arquivo no $path2 não será incluído, pois ele já foi.
require_once($path2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment