Script to add hyperlink when pre-defined text is found?
开发者_开发技巧I'm using PHP to pull some data from an google calendar XML feed, and I'm wondering if there's any kind of script that will run after this and if it finds a certain phrase (not a URL), add a hyperlink to it?
E.g. if it pulls "Bayerische Staatsoper" from the feed it will add a hyperlink for the Staatsoper website.
Is this possible?
Hope that makes sense.
Thanks
str_replace("Bayerische Staatsoper","<a href='#'>Bayerische Staatsoper</a>",$text);
The above code searches for "Bayerische Staatsoper" in variable $text
and replaces it with the link.
精彩评论