【发布时间】:2011-08-16 01:42:19
【问题描述】:
我想替换我网站上的“宽度”和“高度”。
例如:
width="600" height="365"
我想把宽高改成
width="712" height="475"
我可以做到这一点。
$replace =str_replace('width="600" height="365"', 'width="712" height="475"', $replace)
问题是,宽度和高度并不总是 600 和 365,它们可能是其他值。喜欢。
width="222" height="333"
任何...我正在寻找这样的东西:
$replace =str_replace('width="***" height="***"', 'width="712" height="475"', $replace)
这会将宽度和高度内的任何内容替换为“712”和“475”。
有人知道怎么做吗? 谢谢!
【问题讨论】:
-
原始值是如何进入 html 的?
-
Gordon@ file_get_contents 来自另一个站点。谢谢。
标签: php replace size height width