How do pass one array and one string as arguments to a function?

前端 未结 5 1411
感情败类
感情败类 2021-01-13 14:44

Because I can\'t find a convenient way to check if $str is in @array, I\'m trying to make one myself, but it is not working.

I guess it is

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-13 15:24

    You could pass your arguments in reverse order (print ifin($k, @f);), so array is going last. When you catch them now from subroutine, string comes first and array gets populated with any list items after it.

提交回复
热议问题