Parser question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Czubilinski

    Parser question

    Hello,

    I would like to make a simple parser which should work as follows:

    this is my text {link:href=mypa ge,link_text} some other text
    {link:href=othe rpage,other_des cription}

    /|\
    |

    This is a string I would like to store in the database and then load
    in php. Later I would like to insert some other text between { and }
    signs. I would have a function name "link" with one parameter passed.
    Return value of this function would be a string to replace that one
    between { and } signs.

    function link($params)
    {
    ... some logic ...
    return string;
    }

    This function will return something like <a
    href="/mydir/some_file.php"> link_text</a>

    Is there any easy way to do it?

    Paul
Working...