Get a free trial // Grow your CSS skills // Land your dream job


  • # February 3, 2010 at 1:40 pm

    Hello, I recently found this functions and I wanted to know if there was a way with it I can select and change tags?

    This is how I use it…


    function callback($buffer){
    //do something
    return $buffer;

    I wanna do something like changing this…


    Welcome to my website

    To this…


    Welcome to my website

    Is there a way I can do this in my function?

    # February 3, 2010 at 4:35 pm

    Surely it is better to use string replacement?

    # February 3, 2010 at 9:05 pm

    well, personally, I like the strtr command rather than the str_replace one.

    But what I’m talking about is finding a certain tag, and changing it and or the content inside of it.

    # February 4, 2010 at 8:31 am

    You can use preg_replace for that.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed