Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php Привет, подскажите пожалуйста в чем причина? Код: for ($i = 0; $i < count($games); $i++) { $index = mt_rand(0, count($dates) - 1); $date = $dates[$index]; $matches[] = new Matches($date, $games[$i], $stadiums[mt_rand(0, 3)]); unset($dates[$index]); } $dates это массив с датами. При удалении элемента через unset($dates[$index]) выдает ошибку Undefined array key на сточку $date = $dates[$index], хотя unset после выполняется.
Copy Clear