How to cast variable to array April 10, 2023 by Tarik You can cast a variable to an array by using: $var = (array)$arr;