Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From running your code, setting the variables as follow, it works for me:</p> <pre><code>$prodURLS = array('a','b','c'); $itemTitle = array('a'); $urlArraySize = count($prodURLS); $itemtitleArraySize = count($itemTitle); $i = 0; </code></pre> <p>My only recommendations with only this amount of information, are:</p> <ul> <li>To provide more context information, as madth3 suggests.</li> <li>To check the scope in which you are setting/checking values. You may need the <code>&amp;</code> operator to pass variables by reference, or the <code>global</code> keyword to use global variables.</li> <li><p>To use the <code>foreach</code> loop, it will make your code smaller and easier to read. Also you won't need to count the size of the arrays and will have other advantages, e.g. in the use of associative arrays. Again, be careful about the use of variables by reference. For example:</p> <pre><code>foreach ($itemTitle as $item) { foreach ($prodURLS as &amp;$prod) { if ($item == $prod) { $prod = 'MATCH'; } } } unset($prod); //Unset variable set by reference if you are going to use it later on! </code></pre></li> <li><p>Also, you may find useful some of the php array functions like <a href="http://php.net/manual/en/function.array-walk.php" rel="nofollow">array_walk</a>. Check out the PHP Manual on the <a href="http://www.php.net/manual/en/ref.array.php" rel="nofollow">array functions reference</a>.</p></li> </ul> <p>Really, there isn't a lot that can be said from just the code you provided.</p> <p>Good luck.</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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      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