SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Does anyone know an easy way of doing this in php?

    If I have a string which contains numerous HTML tags, how can I convert everything between the <TAG's> from upper case to lower case, while leaving the >Text between the <TAG's>Alone. ???

    Cheers for the help!

  2. #2
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there anyway of doing this by using the strtolower (string) function along with 'another' string function.

    The only ones I've come across which may be of use is the Htnlentities string function - not really sure how this works though?????

  3. #3
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try something like this:
    Code:
    <?
    $foo = 'Hello <BR> How <HR> <A HREF="http://yahoo.com">Are You</a>';
    
    $foo = preg_replace("/<([^>]*)>/ie","'<'.strtolower('\\1').'>'",$foo);
    
    echo $foo;
    ?>
    
    outout: 
    Hello <br> How <hr> <a href=\"http://yahoo.com\">Are You</a>

  4. #4
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks!


Bookmarks

Posting Permissions

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