Return string truncation loop $ return & nbsp; return value: & nbsp; 9 | 50 | 1 | # | 2013-09-09 & nbsp; 00:00:22 | 13814002394 | content | 1 | # | 2013-09-09 & nbsp; 00:00:19 | 13814002394 | content | 1 |#| 2013-09-07 & nbsp; 00:51:57 | 15920531400 | returns a string truncation loop.
The return value of $ return is
9 | 50
| 1 | # | 00:00:22 | 13814002394 | content
| 1 | # | 00:00:19 | 13814002394 | content
| 1 | # | 00:51:57 | 15920531400 | content
| 1 | # | 22:21:02 | 15920531400 | content
| 1 | # | 22:13:14 | 15920531400 | content
| 1 | # | 22:07:42 | 15920531400 | content
| 1 | # | 14:00:02 | 15920531400 | content
| 1 | # | 12:10:13 | 15920531400 | content
| 1 | # | 12:01:27 | 15920531400 | content
| 1 | # |
// This is sorted
Is a regular string (not an array)
I changed to a cyclable array, where time, number, and content are variables !!!!!
------ Solution --------------------
$ Str = '9
------ Solution --------------------
50
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-09 00:00:22
------ Solution --------------------
13814002394
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-09 00:00:19
------ Solution --------------------
13814002394
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-07 00:51:57
------ Solution --------------------
15920531400
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-06 22:21:02
------ Solution --------------------
15920531400
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-06 22:13:14
------ Solution --------------------
15920531400
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-06 22:07:42
------ Solution --------------------
15920531400
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-05 14:00:02
------ Solution --------------------
15920531400
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-05 12:10:13
------ Solution --------------------
15920531400
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
2013-09-05 12:01:27
------ Solution --------------------
15920531400
------ Solution --------------------
Content
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
';
$ New_str = str_replace ('
------ Solution --------------------
','
------ Solution --------------------
', $ Str );
$ Arr = explode ('
------ Solution --------------------
1
------ Solution --------------------
#
------ Solution --------------------
', $ New_str );
$ New_arr = array ();
Foreach ($ arr as $ value)
{
Echo $ value;
If (substr_count ($ value ,'
------ Solution --------------------
')> 1)
{
$ New_arr [] = explode ('
------ Solution --------------------
', $ Value );
}
}
Echo"";
print_R($new_arr);
echo "
";
?>
I simply wrote it and joined it. I don't know if there is any better way.