I am trying to save array value to variable so that I can insert that data/value into mysql using PHP for that I am using a pain taking long code so I want simple method to do it without writing it again and again.
Array shows data like this
Array
(
[0] => Array
(
[0] => a><p class="wp-caption-text">Pendant Heart Images</p></div>
[1] => a><p class="wp-caption-text">Pendant Heart Photos</p></div>
[2] => a><p class="wp-caption-text">Pendant Heart Photos</p></div>
)
[1] => Array
(
[0] => Pendant Heart Images
[1] => Pendant Heart Photos
[2] => Pendant Heart Photos
)
)
Code which I am using to save array value
$a = $g_img[1][0];
$b = $g_img[1][1];
$c = $g_img[1][2];
$a1 = $title[1][0];
$b1 = $title[1][1];
$c1 = $title[1][2];
Mysql query to save data
mysqli_query($con,"INSERT INTO data (Link, Title) VALUES ('$a','$a1')");
mysqli_query($con,"INSERT INTO data (Link, Title) VALUES ('$b','$b1')");
mysqli_query($con,"INSERT INTO data (Link, Title) VALUES ('$c','$c1')");
So If array data increases I have to assign each array value to different variable which is huge process I know there would be a shortcut
Plz Help