Different direction slashes
Example: – C:/wamp/www/AAAMYBUILD
1 2 3 |
echo $dog = dirname($_SERVER['SCRIPT_FILENAME']); |
Example: – C:\wamp\www\AAAMYBUILD
1 2 3 |
echo $dir = realpath('./'); |
Another way is
Example: – C:\wamp\www (running from www folder)
1 2 3 |
echo $down = dirname(__FILE__) ; |
You can also define a path and use it like the following
Example: – C:\wamp\www\campaigns.php (I was running it in the www folder)
1 2 3 4 5 6 |
<?php define( 'ROOT_DIR', dirname(__FILE__) ); echo ( ROOT_DIR.'\campaigns.php' ); ?> |