Reputation: 19
When I echo my path:
echo __DIR__ . '\..\functions\sanitize.php';
I get this:
C:\xampp\htdocs\website\php\core\..\functions\sanitize.php
But it has to be like this:
C:\xampp\htdocs\website\php\functions\sanitize.php
Why doesn't my path go one step back? It doesn't let me get out of the core folder.
What went wrong?
Upvotes: 0
Views: 25
Reputation: 649
You have to call realpath
function as explained here : http://php.net/manual/en/function.realpath.php
Upvotes: 1