Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?
$products = ['option', 'pack', 'servicePlan', 'wheels', 'trim'];
$array = ['option' => '111;2'];
function hasSecondaryProducts ($array) {
foreach ($products as $type) {
echo $type;
if (array_key_exists($type, $array)) {
return 'tes';
}
}
return 'noi';
}
foreach ($products as $type) {
echo $type;
}