Urgent help: the image is read in array (& nbsp; meta_Title & gt; title, & nbsp; meta_Description & gt; share, & nbsp; meta_Keywords & gt; share, & nbsp; intro & gt; & lt; P & gt; & lt; IMGborder0src & q for urgent help, reading images in multiple places
Array (
'Meta _ title' => 'title ',
'Meta _ description' => 'sharding ',
'Meta _ keyword' => 'share ',
'Intro' =>'
',
'Photo _ narrate' => '',
'Photo '=> '1/4_1324877334.jpg ',
)
This is the content of a field stored in the mysql data volume. now I want to read the images in it cyclically. how can I read them?
------ Solution --------------------
I would like to give you a suggestion that, since you store arrays, you should first serialize them once, write them into the database, and perform deserialization during reading. This will help you better deal with them.
------ Solution --------------------
Preg_match_all ("/(? <= Src = \ ") [^ \"] +/", $ arr ['Intro'], $ yy );
Foreach ($ yy [0] as $ key => $ value ){
Echo "image". ($ key + 1). "address:". $ yy ."
";
}
------ Solution --------------------
PHP code
$img_arr = explode("",$array['intro']);$count = count($img_arr);for($i = 0 ; $i<$count; $i++){ $img_arr[$i] = $img_arr[$i]."";}