This post was last edited by GENCC on 2013-09-04 14:49:17
Array paging PHP
This picture is so funny.
This picture is horrible.
Laugh silly.
Convert this data to two arrays.
Image arrays and text arrays
Reply to discussion (solution)
$s = <<< TXT
This picture is so funny.
This picture is horrible.
Laugh silly. TXT; $t = Explode ('
'. Php_eol, $s); foreach (Array_chunk ($t, 2) as $row) { list ($ picture [], $ literal []) = $row;} Print_r ($ picture);p Rint_r ($ text);
Array
(
[0] = =
[1] = =
[2] = =
)
Array
(
[0] = = This picture is so funny.
[1] = = This picture is horrible.
[2] he laughed silly.
)
$s = <<< TXT
This picture is so funny.
This picture is horrible.
Laugh silly. TXT; $t = Explode ('
'. Php_eol, $s); foreach (Array_chunk ($t, 2) as $row) { list ($ picture [], $ literal []) = $row;} Print_r ($ picture);p Rint_r ($ text);
Array
(
[0] = =
[1] = =
[2] = =
)
Array
(
[0] = = This picture is so funny.
[1] = = This picture is horrible.
[2] he laughed silly.
)
How does PHP handle the code like this?
Hey, but a lot of code is different. There are multiple
Of.
Explode (". Php_eol, $s);
How to write it, separate it with pictures.