Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7411463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:23:26+00:00 2026-05-29T06:23:26+00:00

I am using this: echo dirname(__FILE__); which gives: C:\UwAmp\www\myfolder\admin However I am looking for

  • 0

I am using this:

echo dirname(__FILE__);

which gives:

C:\UwAmp\www\myfolder\admin

However I am looking for path until:

C:\UwAmp\www\myfolder\

from current script. How can that be done ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:23:27+00:00Added an answer on May 29, 2026 at 6:23 am

    You could do either:

    dirname(__DIR__);
    

    Or:

    __DIR__ . '/..';
    

    …but in a web server environment you will probably find that you are already working from current file’s working directory, so you can probably just use:

    '../'
    

    …to reference the directory above. You can replace __DIR__ with dirname(__FILE__) before PHP 5.3.0.

    You should also be aware what __DIR__ and __FILE__ refers to:

    The full path and filename of the file. If used inside an include, the name of the included file is returned.

    So it may not always point to where you want it to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In WordPress I am using this code in my functions echo <script type=\text/javascript\> which
I'm using this code now echo $form->input('username'); How do I make sure the label
The output of this echo is not passed on to the next command using
I'm using GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu). And this command: echo -e doesn't print
I am using this code for a slideshow: <img src=<?php echo($array[0]); ?>/> <img src=<?php
Im using this ini_set('post_max_size','40M'); echo ini_get('post_max_size'); And for some reason post_max_size is echoing out
one: i using this code to connect mysql databse which on a shared host.
I am trying to include a .js file I created by using this: echo
In WordPress, I'm using this: while ($wp_query->have_posts()) : $wp_query->the_post(); ?> echo <div class='test'>test</div>; <?php
group_concat(A,' ',B,' ',C) as Name, then using this php for displaying <td><?php echo $row['Name'];

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.