PHP paging. Image delimited Array.

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.