x = 'foo'
x // "foo"
x.length // 3
x === 'foo' // true
x = new String('foo')
x // String { "foo" }
x.length // 3
x === 'foo' // false
x = new String('foo')
x === 'foo' // false
x.substring(0, 3) // 'foo'
x.substring(0, 3) === 'foo' // true
WITH RECURSIVE `cte` AS (
SELECT `id`, `pid`, `name`, 0 AS `level`
FROM `table`
UNION SELECT `p`.`id`, `p`.`pid`, `p`,`name`, `cte`.`level` + 1 AS `level`
FROM `cte`
JOIN `table` AS `p` ON `p`.`id` = `cte`.`pid`
)
SELECT `id`, `name`, `level`
FROM `cte`
ORDER BY `level`
$arTab = ['call', 'fields'];
$arr = [
['id' => 'call', 'communication' => '123'],
['id' => 'fields', 'communication' => '111'],
['id' => 'garden', 'communication' => '4544'],
];
$result = array_values(array_filter(
$arr,
static fn(array $item): bool => !in_array($item['id'], $arTab),
));
var_export($result);
// array (
// 0 => array (
// 'id' => 'garden',
// 'communication' => '4544',
// ),
//)