- array_intersect: documentation ( source)
- array_keys: documentation ( source)
<?php
$srv = array('build', 'calss');
$srv_keys = array_keys($srv);
$cant_be_together = array('build', 'class');
if(count(array_intersect($srv_keys, $cant_be_together)) === count($cant_be_together)) { $str = 1; }