First of all I have a array stored in the variable $magazine_issue_pages that if you print the array shows the following.
Array ( [0] => http://104.131.209.93/wp-content/uploads/2015/02/1.jpg [1] => http://104.131.209.93/wp-content/uploads/2015/02/2.jpg [2] => http://104.131.209.93/wp-content/uploads/2015/02/3.jpg [3] => http://104.131.209.93/wp-content/uploads/2015/02/4.jpg [4] => http://104.131.209.93/wp-content/uploads/2015/02/back.jpg ) 1
So the variable definitly is storing the array properly. However when I go to put it in my foreach statement it is incorrect.
Here is my PHP foreach statement
foreach ($magazine_issue_pages as $magazine_issue_page) {
echo '<div style="background:url('.$magazine_issue_page.')"';
}
It is printing the following in HTML
<div div="" <="" <div="" style="background:url(http://104.131.209.93/wp-content/uploads/2015/02/1.jpg)"></div>
Obviously this isn't what I am looking for ha...
Looking more for something like this
<div style='background:url("http://104.131.209.93/wp-content/uploads/2015/02/1.jpg")'></div>
<div style='background:url("http://104.131.209.93/wp-content/uploads/2015/02/2.jpg")'></div>
<div style='background:url("http://104.131.209.93/wp-content/uploads/2015/02/3.jpg")'></div>
<div style='background:url("http://104.131.209.93/wp-content/uploads/2015/02/4.jpg")'></div>
<div style='background:url("http://104.131.209.93/wp-content/uploads/2015/02/back.jpg")'></div>
Also on a side note when I am writing my echo in my foreach statement I am slightly overwhelmed. As I need to have the url surrounded in " or ' however I already have both of those used in the echo statement so how am I supposed to surround it?
Huge thanks in advance!