Here is my function:
function search_title_and_vendor{
if (stripos($title, 'Tsugi') !== false) {
if (stripos($vendor, 'Puma') !== false) {
return 'Puma Tsugi';
} else {
return '';
}
}
}
Where the variables are:
$title = 'Puma Tsugi'
$vendor = 'Puma'
As you can see I tried to nest the if statement to search for two variables, if they match, return 'Puma Tsugi'. However, this returns nothing.
In my file, I also have occurrences with, for example, Vans Tsugi
, where $vendor = 'Vans';
and $title = 'Vans Tsugi sneakers'
.
How can I search for a combination like this and, return a given value?