I want to convert this array that Array[4] should not give null it can give blank space (empty string).
Array ( [0] => 1 [1] => 4 [2] =>
This will map the array to a new array that utilizes the null ternary operator to either include an original value of the array, or an empty string if that value is null.
$array = array_map(function($v){ return $v ?: ''; },$array);