Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with a foreach statement
    primarykey
    data
    text
    <p>I'd like to renew this question: <a href="https://stackoverflow.com/questions/14798794/populating-a-calendar-with-php-foreach-code">Populating a calendar with PHP foreach code</a></p> <p>The problem has returned for some weird reason, and it says that I have an invalid argument supplied for foreach. What's weird, is that it works on my localhost website all fine.</p> <p>The result should be that the code should display a populated calendar. It does on my localhost server, but it doesn't online, on a website. I'm confused.</p> <p>This has fixed it for my localhost server:</p> <pre><code>foreach(array_merge(array_values($history), array_values($events)) as $event) </code></pre> <p>But when I put the website online, chrome just gives me this:</p> <pre><code>&lt;b&gt;Warning&lt;/b&gt;: array_values() [&lt;a href='function.array-values'&gt;function.array-values&lt;/a&gt;]: The argument should be an array in &lt;b&gt;/home/flyeurov/public_html/lib/skins/flyeuro/events/events_index.tpl&lt;/b&gt; on line &lt;b&gt;30&lt;/b&gt; &lt;b&gt;Warning&lt;/b&gt;: array_merge() [&lt;a href='function.array-merge'&gt;function.array-merge&lt;/a&gt;]: Argument #2 is not an array in &lt;b&gt;/home/flyeurov/public_html/lib/skins/flyeuro/events/events_index.tpl&lt;/b&gt; on line &lt;b&gt;30&lt;/b&gt; &lt;b&gt;Warning&lt;/b&gt;: Invalid argument supplied for foreach() in &lt;b&gt;/home/flyeurov/public_html/lib/skins/flyeuro/events/events_index.tpl&lt;/b&gt; on line &lt;b&gt;30&lt;/b&gt;&lt;br /&gt; </code></pre> <p>The arrays $history and $events are confirmed to work.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload