mardi 22 août 2017

Undefined offset error when trying to store multiple records in laravel [duplicate]

Hello everyone i am facing this issue when trying to store multiple records in database.

The Error says: Undefined index

Here is my code:

$str1 = $request->s_start[$i];
            $str2 = $request->s_end[$i];
            $startint = preg_replace("/[^0-9]/", "", $str1);
            $endint = preg_replace("/[^0-9]/", "", $str2);
            $words = preg_replace('/[[:digit:]]/', '', $str1);

            for ($i = $startint; $i < $endint; $i++) {
                $newstring = $words . $i;

                    $pls = new \App\ItemSeries();
                    $pls->pl_id = $pl->id;
                    $pls->series = $newstring;

                    $pls->save();

            }

Any one please help me out.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire