How can the issue of the input field displaying 'Array[' instead of the value 1 be resolved?

The issue of the input field displaying 'Array[' instead of the value 1 can be resolved by accessing the correct index of the array when setting the value attribute of the input field. By specifying the index of the array where the value is stored, the input field will display the correct value.

<?php
$values = [1, 2, 3];
?>
<input type="text" name="number" value="<?php echo $values[0]; ?>">