Answers for "php avoid undefined index notice"

PHP
6

php undefined index

// Your array index has no value or is not referencing anything,
// The easiest way to overcome this is to simply check whether
// it has been defined
if (isset($arr[$i])) {
	// Do something
}
Posted by: Guest on April-05-2020
0

how to prevent the Undefined index in php

// Before using $_POST['value']    if (isset($_POST['value']))    {              // Instructions if $_POST['value'] exist    }
Posted by: Guest on May-11-2020

Browse Popular Code Answers by Language