I have divided my code php
separated by each of its functions, now the problem is that I call everything through the initial header header
but if I want to test where the separated files are, it shows me an error because the path is specified from the page or the directory major.
How can I search for a file in a different path if it exists or not show a different path?
Example:
{
// Si existe
include_once "inc/db.php";
} else {
//Si no existe la ruta, añadir otra ruta
include_once "inc/confg/db.php";
}
I add an example.