Answer the question
In order to leave comments, you need to log in
How to limit the options for the value of an argument in a method?
Hello! I need to make it so that in the function
function getContent($arg){
//.....
}
Answer the question
In order to leave comments, you need to log in
if the input is an associative array, then for example like this
$arg = array_intersect_assoc($arg, array_flip(['post', 'news', 'comments']))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question