如何更改html输出中的URL? [英] How can I change an URL in html output?

查看:157
本文介绍了如何更改html输出中的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面使用 simplepie 显示来自Facebook RSS提要的内容,显示带有文字的故事和附带的图像(如果有的话)。



这些图像的URL在实际图像之前有一个附加的字符串:



http://external.ak.fbcdn.net/safe_image.php? d = AQDZORAaPpbr5COr& w = 154& h = 154& url = http://example.com/image.jpg



其中http://example.com /image.jpg是我要显示的实际网址。



我想删除& url =以及之前的所有内容输出HTML。



我该怎么办?在此先感谢。

I've got a page using simplepie that displays the content from a Facebook RSS feed showing stories with text and an accompanying image if available.

The URL of these images have an appended string before the actual image:

http://external.ak.fbcdn.net/safe_image.php?d=AQDZORAaPpbr5COr&w=154&h=154&url=http://example.com/image.jpg

Where "http://example.com/image.jpg" is the actual URL I want to show.

I would like to remove "&url=" and everything before it for any URL in the output HTML.

How can I do it? Thanks in advance.

推荐答案

例如,请参阅 http:// webcheatsheet.com/php/regular_expressions.php [ ^ ]。



-SA
See, for example, http://webcheatsheet.com/php/regular_expressions.php[^].

—SA


这篇关于如何更改html输出中的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆