Here is how I define my root folder:
<?php
define('BASEDIR', dirname(__DIR__).'/');
?>
It should be no problem in Linux, or at least that what I think. However, I develop my website on Windows with Wamp, so a slash (/) has been turned into backslash (\). And that's my problem, check my test code:
<?php
echo BASEDIR.'user.json'
//result: C:\wamp\www\website/user.json
?>
What should I do? I can't not just replace all the slash for Linux to backslash for Window. Because in the end, I will upload it to a Linux host.