#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    166
    Rep Power
    15
    I want to convert a URL typed in /ANyCAsE/ to /lowercase/ - the following does work if the URL is lowercase already but not if mixed or upper case. What is incorrect?

    Thanks:

    <?php

    $url_array=explode("/",$REQUEST_URI);

    $url_category_type=$url_array[1];

    $str = strtolower($url_category_type);
    print $str;

    ?>
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    the following does work if the URL is lowercase already but not if mixed or upper case. What is incorrect?
    >>


    strtolower()function convert all the alphabetic characters to uppercase...

    problem may be following:


    Note that 'alphabetic' is determined by the current locale. This means that in i.e. the default "C" locale, characters such as umlaut-A () will not be converted.



    <?php

    $url_array=explode("/",$REQUEST_URI);

    //echo $url_array[1];

    $str = strtolower($url_array[1]);
    echo $str;
    ?>




    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

Similar Threads

  1. Converting numbered strings into int
    By C_rookie in forum C Programming
    Replies: 12
    Last Post: October 6th, 2003, 03:23 PM
  2. manipulating char * strings
    By infamous41md in forum C Programming
    Replies: 2
    Last Post: June 1st, 2003, 12:48 AM
  3. strings vs. constant strings (what's the difference?)
    By Matthew Doucette in forum C Programming
    Replies: 8
    Last Post: March 7th, 2003, 01:00 PM
  4. matching identical parts in two strings
    By mchess in forum PHP Development
    Replies: 11
    Last Post: June 14th, 2002, 03:07 AM
  5. Comparing 2 strings in lowercase?
    By DeNasio in forum PHP Development
    Replies: 3
    Last Post: September 2nd, 2001, 10:23 AM

IMN logo majestic logo threadwatch logo seochat tools logo