new to PHP cicle and array problem

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
php-forum GURU
php-forum GURU
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire

Tue Nov 06, 2012 11:46 pm

Where is are your variables $i and $producto being defined (could do with seing them to make sure your loop will work in the first instance)?

Also, you don't break within your for loop so remove that.
php-forum Fan User
php-forum Fan User
Posts: 53
Joined: Wed Oct 10, 2012 12:14 am

Wed Nov 07, 2012 2:17 am

foreach ($produtos as $plist) {
  if ( in_array($plist, $produto) ) {
    echo $plist . " Found!<br />";
  else {
    echo "Product not found!<br />";
Post Reply