我使用PHP从谷歌日历XML提要中提取一些数据,我想知道是否有任何类型的脚本将在此之后运行,如果它找到某个短语(不是URL),添加一个超链接到它?
。如果它从提要中提取"Bayerische Staatsoper",它将添加一个Staatsoper网站的超链接。
这可能吗?
希望这有意义。
谢谢
str_replace("Bayerische Staatsoper","<a href='#'>Bayerische Staatsoper</a>",$text);
以上代码在变量$text
中搜索"Bayerische Staatsoper",并将其替换为链接。