Undefined Offset Error

Posted 1 year ago by JokersMild85

No idea why I am getting this error, can anyone provide some guidance?

public function store(Request $request)
{
    $values = $request->all();
    $id = Auth::id();
    
    echo "<h2>User ID: ".$id."</h2>";
    
    for($i=0;$i<count($values);$i++)
    {
        $e_id = $values['e_id'][$i];
        echo "<h4>Exercise ID: ".$e_id."</h4>";
        $sets = $values['sets'][$i];
        echo "<h4>Sets: ".$sets."</h4>";
        $reps = $values['reps'][$i];
        echo "<h4>Reps: ".$reps."</h4>";
    } 

}

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.