Answers for "dirname(__file__)"

PHP
2

dir name php

<?php
dirname(__FILE__);
?>
Posted by: Guest on July-04-2020
1

__dirname javascript

console.log(__dirname)     // "/Users/Sam/node-app/cronjobs"
console.log(process.cwd()) // "/Users/Sam/node-app"
Posted by: Guest on March-29-2021
1

__dirname javascript

console.log(__dirname)      // "/Users/Sam/node-app/src/api"
console.log(process.cwd())  // "/Users/Sam/node-app"
Posted by: Guest on March-29-2021
0

php dirname

// dirname ( string $path [, int $levels = 1 ] ) : string

<?php
echo dirname("/etc/passwd") . PHP_EOL;
echo dirname("/etc/") . PHP_EOL;
echo dirname(".") . PHP_EOL;
echo dirname("C:\\") . PHP_EOL;
echo dirname("/usr/local/lib", 2);

// Above example outputs:

/*
	"/etc"
	"/" (or "\" on Windows)
	"."
	"C:\"
	"/usr"
*/
Posted by: Guest on February-24-2020
0

__dirname javascript

node-app
  ├──index.js
  ├──public
  ├──src
  │  ├──helpers.js
  │  └──api
  │      └──controller.js
  ├──cronjobs
  │  ├──pictures
  │  └──hello.js
  └──package.json
Posted by: Guest on March-29-2021

Browse Popular Code Answers by Language