www.webdeveloper.com
Results 1 to 3 of 3

Thread: Converting Underscores to Spaces in Parent Directory Name

  1. #1
    Join Date
    May 2010
    Location
    Washington, DC region
    Posts
    6

    Converting Underscores to Spaces in Parent Directory Name

    Hi!

    I have a little script that I use to get the name of a file's parent directory and use it as a header.

    Code:
    <h1>Index of: <?php
     $convert_toSpace = true;
     $parentdir=basename(dirname(__FILE__));
     global $convert_toSpace;
     echo $parentdir;
    ?></h1>
    This works fine on almost every directory, except one:

    Handover_Letters_and_Claim_Release_Form

    Is there a limit? I have other folders with three underscores, and it works just fine. Does anyone see what I am doing wrong with this one?

  2. #2
    Join Date
    Mar 2009
    Posts
    452
    try
    $parentdir=str_replace('_',' ',basename(dirname(__FILE__)));

    $convert_toSpace has nothing to do with are you asking. i think

  3. #3
    Join Date
    May 2010
    Location
    Washington, DC region
    Posts
    6
    Unfortunately, this did not work. :-(

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles