Text and pictures in a subsector text

Source: Internet
Author: User
Distinguish between text and pictures
There is a paragraph of text as follows, I want to use PHP to make the text part of the assignment to a variable, the picture description of the part to differentiate the assignment to a variable, how to implement the program?

Item Size/spec: 24 cm high, good stuff is worth collecting.

700? 700:true); "title=" 1.jpg "/>

700? 700:true); "title=" 2.jpg "/>

700? 700:true); "title=" 3.jpg "/>



------to solve the idea----------------------
Does the picture description part refer to each title? There's more than that.
------to solve the idea----------------------
$str 1 is a literal description
$str 2 is a picture description


$content =<< <>

Item Size/spec: 24 cm high, good stuff is worth collecting.

700? 700:true); "title=" 1.jpg "/>

700? 700:true); "title=" 2.jpg "/>

700? 700:true); "title=" 3.jpg "/>



TXT;

$data = Explode ('

', $content);
$str 1 = $data [0]. '

';
unset ($data [0]);
$str 2 = '

'. Implode ('

', $data);

echo $str 1;
echo $str 2 ';


------to solve the idea----------------------

$s = '

Item Size/spec: 24 cm high, good stuff is worth collecting.

700? 700:true); "title=" 1.jpg "/>

700? 700:true); "title=" 2.jpg "/>

700? 700:true); "title=" 3.jpg "/>


';
Preg_match_all ('/[\x7f-\xff]+/', $s, $a);
$s 1=implode (", $a [0]);
Preg_match_all ('/title= ' (. *?) " /', $s, $b);
echo $s 1; Text section
Print_r ($b [1]); Picture description
  • 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.