Jump to content

[SOLVED] Undefined offset


The Little Guy

Recommended Posts

I am programming with Strict programming, and when I loop through an array, I get:

 

Notice:  Undefined offset:  0 in /home/.marble/ryannaddy/dudeel.com/video/watch.php on line 283

 

Here is my function:

                    function description($input){
                        $strs = explode(' ',$input);
                        $maxlen = 10;
                        $str = array();
                        for($i=0;$i<$maxlen;$i++){
                            $str[0] .= $strs[$i].' ';  // Line 283
                        }
                        for($j=$i;$j<count($strs)-$i;$j++){
                            $str[1] .= $strs[$j].' ';
                        }
                        return $str;
                    }

Link to comment
https://forums.phpfreaks.com/topic/133286-solved-undefined-offset/
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.