Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to go one folder back in __dir__ in php

For PHP < 5.3 use:

$upOne = realpath(dirname(__FILE__) . '/..');
In PHP 5.3 to 5.6 use:

$upOne = realpath(__DIR__ . '/..');
In PHP >= 7.0 use:

$upOne = dirname(__DIR__, 1);
Comment

how to go one folder back in __dir__ in php

// One level up
echo str_replace(realpath(dirname(__FILE__) . '/..'), '', realpath(dirname(__FILE__)));

// Two levels etc.
echo str_replace(realpath(dirname(__FILE__) . '/../..'), '', realpath(dirname(__FILE__)));
Comment

how to go one folder back in __dir__ in php

dirname(__DIR__,level);
dirname(__DIR__,1);
Comment

PREVIOUS NEXT
Code Example
Php :: update url wordpress 
Php :: composer create project laravel with version 
Php :: epoch to date php 
Php :: woocommerce view order details frontend with shortcode 
Php :: Laravel route not calling function of controller 
Php :: firstOrFail() 
Php :: php echo html and variable 
Php :: flatten in array php 
Php :: php get first two paragraphs 
Php :: remove time from date in carbon 
Php :: php max int 
Php :: sum two numbers in php 
Php :: php pdo like 
Php :: disadvantages of php 
Php :: Invalid credentials. symfony 
Php :: get current user in symfony 
Php :: wp_query custom post type 
Php :: laravel request file empty 
Php :: Try raising max_execution_time setting in php.ini file (CentOS path is /etc/php.ini): max_execution_time = 300Fix 504 Gateway Timeout using Nginx 
Php :: laravel migration bigint length 
Php :: htaccess new date timestamp 
Php :: how to import in laravel excel command 
Php :: PHP sha1 — Calculate the sha1 hash of a string 
Php :: storefront remove sidebar from product page 
Php :: PHP Parses a time string according to a specified format 
Php :: flutter fetch database from mysql using php 
Php :: activerecord yii2 select with limit(start,end) not working 
Php :: octobercms mail register 
Php :: reindex after post api magento 2 
Php :: required_unless laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =