Answers for "dirname(__DIR__) en php"

PHP
0

__dir__ in php

<?php
include __DIR__ . "/worker_2.php";
Posted by: Guest on January-03-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

Browse Popular Code Answers by Language