PHP paging. image separator array. this post was last edited by gencc from 2013-09-0414: 49: 17 & lt; img & nbsp; src = "1.jpg" & gt; & lt; br & nbsp; /& gt; This picture is so funny & lt; br & nbsp;/& gt; & lt; img & n PHP paging. image separator array.
This post was last edited by gencc at 14:49:17
This picture is so funny.
This picture is terrible.
Silly smile.
Convert the data into two arrays.
Image array and text array
Array pagination php shares: This picture is so funny This picture is terrible.
------ Solution --------------------
$ S = <TXT
This picture is so funny.
This picture is terrible.
Silly smile.
TXT;
$ T = explode ('
'. PHP_EOL, $ s );
Foreach (array_chunk ($ t, 2) as $ row ){
List ($ image [], $ text []) = $ row;
}
Print_r ($ Image );
Print_r ($ text );
Array
(
[0] =>
[1] =>
[2] =>
)
Array
(
[0] => This picture is so funny.
[1] => This picture is terrible.
[2] => silly smile.
)