Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $arrIntPropertyIds = [ 1,2,3,4,5,6,7,8,9,10]; $arrIntRequestPropertyIds = [ 3, 5, 7]; $intersect = count(array_intersect($arrIntPropertyIds, $arrIntRequestPropertyIds)); if ($intersect == count($arrIntRequestPropertyIds)) { echo '$arrIntPropertyIds include all of $arrIntRequestPropertyIds'; } elseif ($intersect > 0) { echo '$arrIntPropertyIds include part of $arrIntRequestPropertyIds'; } else { echo '$arrIntPropertyIds not include any of $arrIntRequestPropertyIds'; }
Copy Clear