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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:35:19+00:00 2026-06-16T00:35:19+00:00

its a mystery to me why this is happening. so here is the code:

  • 0

its a mystery to me why this is happening. so here is the code:

$dir = 'test/';
$de = opendir($dir);
if ($de) {
    while (($file = readdir($de)) !== false) {
        $path = $dir . $file;
        $file_title = 'this text gets repeated three times, each followed by a dot' . $file;
        echo $file;
    }
} else {
    echo "invalid directory";
}

so If $file= video.mp4 and $file_title=’file name’.$file; it would look like this:

‘file name.file name.file namevideo.mp4’ and if there were no string before the variable, ie $file_title=$title there would be three dots before the variable like this: …video.mp4

if anyone has any idea what’s happening please let me know. Thanks.

  • 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-06-16T00:35:20+00:00Added an answer on June 16, 2026 at 12:35 am

    You are listing the . and .. directories, use is_file() to check so the entry is really a file and not a directory:

    if (is_file($dir . $file)) {
       // entry is a file
    }
    

    Here you can read more about the dot directories: There’s a lot in the dot

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

Sidebar

Related Questions

Its too much code to paste here so, I have created demo please have
I know I'm reaching for straws here, but this one is a mystery... any
Granted... this is a dumb question, but it's still a mystery to someone like
Its more of a best practices sort of question. Here it goes... I have
Its hard to explain this so I'll try my best. Is it possible to
Its posible to do this in actionbar sherlock? I know how set the icons
Its a interview question. Interviewer asked this basic shell script question when he understand
I've been trying to solve this mystery almost 2 hours, this is giving me
Please, may somebody explain me, what can raise an exception in this code? function
This is a bit of a mystery to me since you have to be

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.