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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:50:53+00:00 2026-05-21T05:50:53+00:00

$dir = ‘/web99/web/direcotry/filename’; I need to drop ‘/web99/web/’ from the directory on the fly.

  • 0
$dir = '/web99/web/direcotry/filename';

I need to drop ‘/web99/web/’ from the directory on the fly.

I tried:

$trimmed = ltrim($dir, "/web99/web/");

however if a directory started with a w,e,b,9 the first letter of the directory was cut off.

How can I drop only what I want and not every character like that?

  • 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-21T05:50:54+00:00Added an answer on May 21, 2026 at 5:50 am

    $dir = preg_replace('$^/web99/web/$', '', $dir);

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

Sidebar

Related Questions

I have a directory Dir in which I have about 30 sub-directories. From these
File: /home/USER/DIR/a http://www.here.is.a.hyper.link.net/ /home/USER/DIR/b http://www.here.is.another.hyper.link.net/ Need to remove all the odd lines in this
I use use lib ./DIR to grab a library from a folder elsewhere. However,
I can chroot with Dir.chroot Dir.chroot(/var/chroot/mychroot) But how can I return back from chroot?
My web is dir structured is as follows : moving/       includes/       controllers/       includes/       etc...
I got this colored dir script from http://tasteofpowershell.blogspot.com/2009/02/get-childitem-dir-results-color-coded.html : function ls { $regex_opts =
Consider this code: string dir = Environment.CurrentDirectory + @\a; Directory.CreateDirectory(dir); FileSystemWatcher watcher = new
I have a directory structure as follows dir----| | |--dir1\ some\ thing--result.pdf | |--dir2\
I have directory structure: DIR |-component_name |-source |-setup.exe |-another_component_name |-source |-setup.exe |-yet_another_component_name |-source |-setup.exe
I have directory structure: DIR |-UNINSTALL.BAT |-component_name |-source |-setup.exe |-uninst.bat |-another_component_name |-source |-setup.exe |-uninst.bat

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.