array (size=10)
'image' =>
array (size=3)
0 => string 'BlackLingerie(42).jpg' (length=21)
1 => string 'BlackLingerie(43).jpg' (length=21)
2 => string 'BlackLingerie(44).jpg' (length=21)
'text' =>
array (size=3)
0 => string '' (length=0)
1 => string '' (length=0)
2 => string '' (length=0)
'author' =>
array (size=3)
0 => string '' (length=0)
1 => string '' (length=0)
2 => string '' (length=0)
'date' =>
array (size=3)
0 => string '' (length=0)
1 => string '' (length=0)
2 => string '' (length=0)
'verImage' =>
array (size=3)
0 => string 'upload' (length=6)
1 => string 'upload' (length=6)
2 => string 'upload' (length=6)
'imagePicsPath' =>
array (size=3)
0 => string 'http://127.0.0.1/develop/mvc/public/images/pics/BlackLingerie(42).jpg'/' (length=77)
1 => string 'http://127.0.0.1/develop/mvc/public/images/pics/BlackLingerie(43).jpg'/' (length=77)
2 => string 'http://127.0.0.1/develop/mvc/public/images/pics/BlackLingerie(44).jpg'/' (length=77)
'imageThumbPath' =>
array (size=3)
0 => string 'http://127.0.0.1/develop/mvc/public/images/thumbs/BlackLingerie(42).jpg'/' (length=79)
1 => string 'http://127.0.0.1/develop/mvc/public/images/thumbs/BlackLingerie(43).jpg'/' (length=79)
2 => string 'http://127.0.0.1/develop/mvc/public/images/thumbs/BlackLingerie(44).jpg'/' (length=79)
'imagePath' =>
array (size=3)
0 => string 'http://127.0.0.1/develop/mvc/public/images/pics/BlackLingerie(42).jpg'/' (length=77)
1 => string 'http://127.0.0.1/develop/mvc/public/images/pics/BlackLingerie(43).jpg'/' (length=77)
2 => string 'http://127.0.0.1/develop/mvc/public/images/pics/BlackLingerie(44).jpg'/' (length=77)
'imageID' =>
array (size=3)
0 => string '0' (length=1)
1 => string '1' (length=1)
2 => string '2' (length=1)
'submitUploadImages' => string 'Ladda upp bilder till databas' (length=29)
この配列をより有用な配列に再構築したい。このような
array
( [image0] (
'name' =>
'text' =>
'author' =>
'date' =>
'verImage' =>
'imagePicsPath' =>
'imageThumbPath' =>
'imagePath' =>
'imageID' =>
)
[image1] (
'name' =>
'text' =>
'author' =>
'date' =>
'verImage' =>
'imagePicsPath' =>
'imageThumbPath' =>
'imagePath' =>
'imageID' =>
)
画像の数に応じて、画像配列内のキーが各画像の値を保持します。名前、パスなど。受信配列は、複数のフォーム入力データを保持する $_POST です。これをクラックするには助けが必要です。$_POST 配列を反復処理し、コンテンツを取得して新しい配列に変換する必要がありますか?
データベースで作業を行う前に、画像情報を保持する一意の画像配列が必要です =)