I'm working with the following code kindly supplied in an answer here but it generates the following errors
Warning: array_map() [function.array-map]: Argument #2 should be an array in [path/to] on [Line #]
and
'Warning: Wrong parameter count for array_intersect() in [path/to] on [line #]'
Googleing the errors has produced no useful ideas - any help appreciated.
<?php
$types = array('.pdf', '.doc', '.xls');
if(0 < count(array_intersect(array_map('strtolower', $filename, $types)))) {
echo 'One';
} else {
echo 'Two';
}
?>
//update
<?php
$filename = array(get_post_meta(get_the_ID(), 'mjwlink-url'));
$types = array('.pdf', '.doc', '.xls');
if(0 < count(array_intersect(array_map('strtolower', $filename), $types))) {
echo 'One';
} else {
echo 'Two';
}
?>