I've been confused due to the result being true in both cases, with or without using ABSPATH constant for this:
if (file_exists(ABSPATH . 'wp-config.php')){
echo "true";
}
or
if (file_exists('wp-config.php')){
echo "true";
}
Please note that the file running this code is not in the root directory (it's in a subfolder inside a plugin folder in wp-content/plugins
directory).
Any explanation would be helpful please. Also which one should I prefer to use.