Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: List CSS Styles

  1. #1
    Regular Coder
    Join Date
    Apr 2007
    Location
    Griffith. Australia
    Posts
    138
    Thanks
    4
    Thanked 4 Times in 4 Posts

    List CSS Styles

    Does anyone have any idea how I could create an array of all the css styles I have in a .css file. I need to be able to create a list of them all, and sort them alphabetically.

  • #2
    Banned
    Join Date
    Apr 2007
    Posts
    428
    Thanks
    29
    Thanked 5 Times in 5 Posts
    First you start with file_get_contents.
    Or similar function to read your .css file.

    After you should use something like preg_match or similar function, with some wicked regular expresion to get only you css names, and a function to store those matches in array.

    Sorting by name would be an easier job in your program.

    I hope this helped. But you should know that reading files, and using regular expressions are one of the hardest things to do for a PHP programmer. (eg. a search script)


  •  

    Posting Permissions

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