Jump to content

foreach() error


studiosx

Recommended Posts

I want to export videos, thumbs, duration, etc from my website into a xml format.

I got this error:
Invalid argument supplied for foreach()

$output .= ' <clips>';

if (!is_array( $vids )) {
    $vids = array(  );
    foreach ($imgs as $img) {
        $img = explode( '.', $img );
        $vids[] = '0' . $img[0] . '.flv';
    }
}

@sort( $vids );
@sort( $imgs );
$i = 38;
foreach ($vids as $v) {
    $output .= ' <clip>';
    $output .= '  <duration>' . $duration . '</duration>';
    $output .= '  <width>' . $width . '</width>';
    $output .= '  <height>' . $height . '</height>';
    $output .= '  <flv>' . $v . '</flv>';
    $output .= '   <screens>   <screen>' . trim( $imgs[$i] ) . '</screen>   </screens>';
    $output .= ' </clip>';
    ++$i;
}

$output .= ' </clips>';

Thank you!

Link to comment
https://forums.phpfreaks.com/topic/287151-foreach-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.