Use regular expressions to separate the text and image areas and extract the following html code from the database: HTMLcode & lt; p & gt; & lt; em & gt; 2012 spring/summer wedding week concluded in New York, VOGUE Fashion Network provides the most comprehensive authoritative reports. Select your own wedding dress for your childhood dream wedding in spring! & Lt; em & gt; & lt; p & gt; AlvinaValenta's wedding Conference is a permanent regular expression to separate text and image areas.
Extract the following html code from the database
HTML code
2012 spring and summer wedding dress Fashion Week came to an end in New York, and VOGUE Fashion Network presented the most comprehensive authoritative report. Select your own wedding dress for your childhood dream wedding in spring!
Alvina Valenta's wedding Conference is truly an everlasting task. The 2012 spring/summer wedding dress is equally impeccable. although there are not many pieces displayed, almost all the elements of the 2012 wedding dress are included. The geometric pleat of the previous season also needs to flash.
Elegant, elegant, modern, retro, gorgeous, low-key, and even inexplicable sweet and fresh ...... None of these features are shown in the Alvina Valenta 2012 Spring/Summer Wedding series. This kind of perfection is deliberate or unintentional, and is perfect in any case.
To extract the code and save it to an array, the p tag is an element in a unit .. To achieve the following results:
PHP code
$ Arr [0] =>"2012 spring and summer wedding dress Fashion Week came to an end in New York, and VOGUE Fashion Network presented the most comprehensive authoritative report. Select your own wedding dress for your childhood dream wedding in spring!"; $ Arr [1] =>" Alvina Valenta's wedding Conference is truly an everlasting task. The 2012 spring/summer wedding dress is equally impeccable. although there are not many pieces displayed, almost all the elements of the 2012 wedding dress are included. The geometric pleat of the previous season also needs to flash. "; $ Arr [2] =>" elegant, elegant, modern, retro, gorgeous, low-key, and even inexplicable sweet and fresh ...... None of these features are shown in the Alvina Valenta 2012 Spring/Summer Wedding series. This kind of perfection is deliberate or unintentional, and is perfect in any case. "$ Arr [3] =>" http://static.aishang.cn/itemicon/20111012/8a52fa290ae06da4.jpg "; // filter out the img tag, only the url of the image $ arr [4] => "http://static.aishang.cn/itemicon/20111012/5f7298516446aee4.jpg ";......
------ Solution --------------------
PHP code
$ Str = <
2012 spring and summer wedding dress Fashion Week came to an end in New York, and VOGUE Fashion Network presented the most comprehensive authoritative report. Select your own wedding dress for your childhood dream wedding in spring!
Alvina Valenta's wedding Conference is truly an everlasting task. The 2012 spring/summer wedding dress is equally impeccable. although there are not many pieces displayed, almost all the elements of the 2012 wedding dress are included. The geometric pleat of the previous season also needs to flash.
Elegant, elegant, modern, retro, gorgeous, low-key, and even inexplicable sweet and fresh ...... None of these features are shown in the Alvina Valenta 2012 Spring/Summer Wedding series. This kind of perfection is deliberate or unintentional, and is perfect in any case.
HTML; $ pat = '/
((? :(? : [^ <] [^ I]. *) | (? : <[^ I]. +) <\/p> |
. + "(. +)". + <\/P>/isU '; preg_match_all ($ pat, $ str, $ matches); echo'
';print_r(array_filter(array_merge($matches[1],$matches[2])));echo '
';/* Array ([0] => 2012 spring/summer wedding dress Fashion Week came to an end in New York. VOGUE Fashion Network presented the most comprehensive authoritative report. Select your own wedding dress for your childhood dream wedding in spring! [1] => Alvina Valenta's wedding Conference is truly an everlasting task. The 2012 spring/summer wedding dress is equally impeccable. although there are not many pieces displayed, almost all the elements of the 2012 wedding dress are included. The geometric pleat of the previous season also needs to flash. [2] => elegant, elegant, modern, retro, gorgeous, low-key, and even inexplicable sweet and fresh ...... None of these features are shown in the Alvina Valenta 2012 Spring/Summer Wedding series. This kind of perfection is deliberate or unintentional, and is perfect in any case. [19] => http://static.aishang.cn/itemicon/20111012/8a52fa290ae06da4.jpg [20] => http://static.aishang.cn/itemicon/20111012/5f7298516446aee4.jpg [21] => http://static.aishang.cn/itemicon/20111012/ae43d4916580016f.jpg [22] => http://static.aishang.cn/itemicon/20111012/2d2c62d7340b1c5d.jpg [23] => http://static.aishang.cn/itemicon/20111012/8d419088f69405dd.jpg [24] => http://static.aishang.cn/itemicon/20111012/0a85c721b25f88ee.jpg [25] => http://static.aishang.cn/itemicon/20111012/61ba8bb55943f94d.jpg [26] => http://static.aishang.cn/itemicon/20111012/9dd0274b9e35cf6a.jpg [27] => http://static.aishang.cn/itemicon/20111012/ae5127da3395ccbd.jpg [28] => http://static.aishang.cn/itemicon/20111012/0001969b49e5d288.jpg [29] => http://static.aishang.cn/itemicon/20111012/8932423815d02415.jpg [30] => http://static.aishang.cn/itemicon/20111012/7da7965ed5435fda.jpg [31] => http://static.aishang.cn/itemicon/20111012/99fde461bc846891.jpg )*/