回來字串截取迴圈

來源:互聯網
上載者:User
返回字串截取迴圈
$return 傳回值為
9||50
||1|#|2013-09-09 00:00:22||13814002394||內容
||1|#|2013-09-09 00:00:19||13814002394||內容
||1|#|2013-09-07 00:51:57||15920531400||內容
||1|#|2013-09-06 22:21:02||15920531400||內容
||1|#|2013-09-06 22:13:14||15920531400||內容
||1|#|2013-09-06 22:07:42||15920531400||內容
||1|#|2013-09-05 14:00:02||15920531400||內容
||1|#|2013-09-05 12:10:13||15920531400||內容
||1|#|2013-09-05 12:01:27||15920531400||內容
||1|#|

//這是整理過的

是有規則的字串(不是數組)
我變成可迴圈的數組 其中時間,號碼,內容是變數!!!!!

1592053140015920531400138140023942013-09-06 22:21:0215920531400內容
$str='91592053140015920531400#內容
2013-09-05 14:00:022013-09-06 22:13:14內容
#113814002394#2013-09-05 12:01:272013-09-07 00:51:5711#內容
#50
','內容
2013-09-05 12:10:13#1';
$new_str=str_replace('11#12013-09-09 00:00:22內容
',$new_str);
$new_arr=array();
foreach ($arr as $value)
{
echo $value;
if (substr_count($value,'內容
1',$str);
$arr=explode('2013-09-06 22:07:4215920531400##2013-09-09 00:00:1915920531400',$value);
}
}
echo "
";
print_R($new_arr);
echo "
";
?>
簡單的寫了下,湊合著能,不知道有沒有什麼更好的辦法
')>1)
{
$new_arr[]=explode('內容
1內容
1#1#
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.