This function returns true if the given interface is a slice, otherwise it returns false.
func InterfaceIsSlice(t interface{}) bool {
switch reflect.TypeOf(t).Kind() {
case reflect.Slice:
return true
default:
return false
}
}
Code language: PHP (php)