调整嵌入代码 PHP 的大小
我可以使用 PHP (也许使用正则表达式)有效地自动调整嵌入代码的大小吗?
这是嵌入代码的示例:
<object width="500" height="350">
<param name="movie" value="http://www.megavideo.com/v/"></param>
<param name="allowFullScreen" value="true"></param>
<embed src="http://www.megavideo.com/v/"
type="application/x-shockwave-flash"
allowfullscreen="true"
width="500" height="350">
</embed>
</object>
Can I automatically resize an embed code efficiently using PHP (maybe with regex?)
Here's an example of the embed code:
<object width="500" height="350">
<param name="movie" value="http://www.megavideo.com/v/"></param>
<param name="allowFullScreen" value="true"></param>
<embed src="http://www.megavideo.com/v/"
type="application/x-shockwave-flash"
allowfullscreen="true"
width="500" height="350">
</embed>
</object>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您的问题是如何更改
相反,您可能会想要使用 JavaScript。为您的对象命名,然后使用 JavaScript(如果必须的话,可以使用 jQuery 等)来更改尺寸。这将允许您更改尺寸而无需重新加载页面。
I think your question is asking how to change the width and height of the
<object>
tag? If so, if you want to use PHP, you'll have to refresh the page, which you probably don't want to do in this case, since your user will have to reload the video (obviously you would simply output new values to thewidth
andheight
values).Instead, you're probably going to want to use JavaScript. Give your object a name, and use JavaScript (with jQuery, etc. if you must) to change the dimensions. This will allow you to change the dimensions without reloading the page.
做类似的事情
(代码未经测试)
Do something like
(code untested)