Hi, I'm a new member and I would like some help, if possible. I am trying to make a PHP script that will turn X lines of image urls and display 3 images in a row with their array key in the row below, showing up in a HTML table.
The output i'm trying to achieve is
<table>
<tr><td>img1</td><td>img2</td><td>img3</td></tr>
<tr><td>0</td><td>1</td><td>2</td></tr>
<tr><td>img4</td><td>img5</td><td>img6</td></tr>
<tr><td>3</td><td>4</td><td>5</td></tr>
</table>
This is what I have so far: I can input my image urls with a space between and display the array key and value.
form.html
<form action="ariel.php" method="post">
<textarea cols="60" rows="10" name="images"> </textarea>
<br />
<input type="submit" value="submit" />
</form>
ariel.php
<?php
$array = explode (' ', $_POST['images']);
foreach($array as $key => $value)
{
echo "$key $array <br />";
}
?>
Any help is greatly appreciated.