The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

PHP question (3 posts)

  1. Anonymous
    Posted 12 years ago #

    I have a string that includes a tag (that needs to be replaced), however the tag is not fixed, though it has a fixed mask: tag-name(%parameter).
    Ok.. now the hard part. Is there a PHP function that will return such substrings, i.e. all substrings that match a certain mask?
    What I want to accomplish is to replace the tag with some text, based on the specified parameter.
    Thank you kindly for any suggestions,

  2. Zarniwoop
    Posted 12 years ago #

    What about preg_replace_callback?

  3. Anonymous
    Posted 12 years ago #

    Thank you very much.. :)
    Now the problem is to figure out the right pattern (regular expression), to allow for:
    <mytag=keyword>, (ex. <mytag=5> or <mytag='some text'>)
    <mytag=keyword1, keyword2...> (ex. <mytag=5, 'some text'>)
    I ask a lot... I know :)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.