Osclass Support Forums

Osclass theme support => Free themes => Elena Osclass Responsive Theme => Topic started by: dollar4all on March 18, 2020, 09:43:36 PM

Title: PHP Warning: Invalid argument supplied for foreach()
Post by: dollar4all on March 18, 2020, 09:43:36 PM
hi,

PHP Warning:  Invalid argument supplied for foreach() in /search.php on line 127
<?php foreach ($aCities as $city) {?>

 thank you
Title: Re: PHP Warning: Invalid argument supplied for foreach()
Post by: MB Themes on March 19, 2020, 10:22:17 AM
@dollar4all
Try this:
Code: [Select]
<?php if(count($aCities) > && is_array($aCities)) {?>
  <?php foreach ($aCities as $city) {?>

  <?php ?>
<?php ?>
Title: Re: PHP Warning: Invalid argument supplied for foreach()
Post by: dollar4all on March 19, 2020, 10:46:59 AM
hi, thank you

when i applied got this error
PHP Parse error:  syntax error, unexpected '}', expecting end of file in /search.php on line 135
 <?php } else { ?>

thank you