![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 andyto202 ![]()
![]() |
內容為 start a1 b2 c3 d4 e5 show time a1 b2 c3 d4 e5 show time a1 b2 c3 d4 e5 end 假設我要抓取 start跟end 中間的文字 我有寫出來如下 執行結果是 a1 b2 c3 d4 e5 show time a1 b2 c3 d4 e5 show time a1 b2 c3 d4 e5 假設我想要程式看到第【2】個 show time 結束 理論上的結果應該是 a1 b2 c3 d4 e5 show time a1 b2 c3 d4 e5 我把下面程式碼中的 【strpos】 換成 【strrpos】 【end】 換成 【show time】 if(strpos($buffer, "end") !== false) { break; } 改成 if(strrpos($buffer, "show time") !== false) { break; } 可是結果為 a1 b2 c3 d4 e5 請問大家要如何用 strpos 和 strrpos 來找出範圍呢 謝謝
搜尋相關Tags的文章:
[ 抓出文字檔的範圍 ] ,
本篇文章發表於2019-05-14 08:57 |