I am trying to loop an array and use it’s value for my html code…
I have
array as...
title1
http://link...
1024 //window width
700 //window height
title2
http://link2...
1024 //window width
700 //window height
more...
My foreach loop.
foreach ($line as $field){
echo "<a href='http://link...'>title1</a>";
echo "<h1>1024</h1>"; //window width
echo "<h2>700</h2>"; //window height
}
How can do distingquish these values and show them in the page? Thanks for the help!
Based on your comments, your data has a comma-separated format with all 4 fields in one line:
Simply, read the file line-by-line, then use
explodeto split the line into an array (using the comma,as delimeter).}