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 520097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:06:34+00:00 2026-05-13T08:06:34+00:00

One problem I see all over the place is the big question: must I

  • 0

One problem I see all over the place is the big question: “must I put an / in front of a path, or must I not?”

Sorry if this appears subjective, but for my framework it’s an important question:
Do you think that it’s more logical to put a “/” in front of every path when specifying one, or do you think the “/” prefix should be avoided?

Or should I check if the first char is “/” and if not, add that automatically?

Context: Framework functions that take paths.

  • 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-13T08:06:34+00:00Added an answer on May 13, 2026 at 8:06 am

    If you put a / in front of every path, then those paths are absolute. Without it, they are relative. Not sure what you’re after, but that’s what the / at the beginning is for.

    For example, if your current directory is /var/www/html/ and you give your path as foo/bar/, the path becomes /var/www/html/foo/bar/.

    If you give your path as /foo/bar/, then the path is just that, with nothing prepended.

    So the forward slash is just a matter of where you’re looking the files from, and if you’re using the paths as a argument to a function, you probably want to pass them as relative (to the framework directory).

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

Sidebar

Related Questions

I have been all over this one, and I am just plumb stuck. I
I've searched all over and I can't figure this one out. I am working
I think this is going to be one of those simple-when-you-see-it problems, but it
I am reposting this question due to inability to solve the problem (original here
I've been laboring over this problem for the past two days. I am attempting
I've searched for a solution for my problem all over but I cannot find
IMPORTANT UPDATE This question was made over 9 years ago. It made sense then,
When I look at optimization problems I see a lot of options. One is
I got one problem at my exam for subject Principal of Programming Language. I
I am having one problem with the PHP json_encode function. It encodes numbers as

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.