私は段落のランダムな文字列から単語を探しています。3つの既知の単語から文字列を見つけるには?
<head>
<style>
* {padding-top:10px; margin:0;}
body {overflow:hidden;}
</style>
<script src="http://content.jwplatform.com/libraries/V6NfEzT7.js"></script>
</head>
<center> <body>
<div id="player"></div>
<script>
jwplayer('player').setup({
sources: [{
file: "rtmp://163.172.67.164:80/live",
file: "http://163.172.67.164/live/chsix/index.mp4?dsgfsdksdfbjdbfsdfsdkfs121413r"
}],
width: "60%",
aspectratio: "16:9",
hlshtml: true
});
</script>
<!-- Histats.com (div with counter) --><div id="histats_counter"></div>
<!-- Histats.com START (aync)-->
<script type="text/javascript">var _Hasync= _Hasync|| [];
_Hasync.push(['Histats.startgif', '1,3597882,4,10045,"div#histatsC {position: absolute;top:0px;left:0px;}body>div#histatsC {position: fixed;}"']);
_Hasync.push(['Histats.fasi', '1']);
_Hasync.push(['Histats.track_hits', '']);
(function() {
var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;
hs.src = ('//s10.histats.com/js15_gif_as.js');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);
})();</script>
<noscript><a href="/" alt="" target="_blank" ><div id="histatsC"><img border="0" src="http://s4is.histats.com/stats/i/3597882.gif?3597882&103"></div></a>
私は "http://163.172.67.164/live/chsix/index.mp4?dsgfsdksdfbjdbfsdfsdkfs121413r" を見つけたいです。 既知のユニークワードは「mp4」です。 "mp4"の位置を見つけて、二重引用符の位置を前後に見つけることはできますか?出来ますか?
$html_encoded = htmlentities($text);
$pos = strpos($html_encoded, ".mp4");
$pos1 = strpos($html_encoded, '"');
echo substr($html_encoded,$pos-50,100)."<br>";
しかし、全体の二重引用符で囲まれた文を見つけることは無意味です:
私の少しの努力です。親切に私にそれを解決するように提案してください。
がしますか? – brad
この行を印刷したい場合 - 「http://163.172.67.164/live/chsix/index.mp4?dsgfsdksdfbjdbfsdfsdkfs121413r」 –
あなたが言及している「文字列段落」の例を投稿することを検討してください。 – Craig