在
我想删除所有内容,并且只想要 php 中标签之间的特定值, 这是我想要的代码:
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F17181143"></param> <param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F17181143" type="application/x-shockwave-flash" width="100%"></embed>
</object>
<span>
<a href="http://soundcloud.com/kiwinest/linkin-park-iridescent">Linkin Park - Iridescent</a> by <a href="http://soundcloud.com/kiwinest">KiwiNest</a>
</span>
我只想要 17181143 这个值,并想删除其他所有内容。
I want to remove everything, and only want a particular value between tags in php,
here is the code what I want:
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F17181143"></param> <param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F17181143" type="application/x-shockwave-flash" width="100%"></embed>
</object>
<span>
<a href="http://soundcloud.com/kiwinest/linkin-park-iridescent">Linkin Park - Iridescent</a> by <a href="http://soundcloud.com/kiwinest">KiwiNest</a>
</span>
I just only want 17181143 this value and want to remove everything else..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用简单 HTML DOM 库:
输出:
注释:
Using the Simple HTML DOM Library:
Output:
Notes:
您可以使用 PHP 和 REGEX 将数字提取到数组中,从而丢弃其他所有内容。
You can use PHP and REGEX to pull out the numbers into an array and thereby discarding everything else.