3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Test cases from user's Project $people = array("DHL Guest PayPal", "DHL Guest BT", "DHL Guest Bank", "DHL Ret PayPal", "DHL Ret BT", "DHL Ret Bank", "DHL Wh PayPal", "DHL Wh BT", "DHL Wh Bank", "ACS Guest PayPal", "ACS Guest BT", "ACS Guest Bank", "ELTA Wh PayPal", "ELTA Wh BT", "ELTA Wh Bank"); //15 $count_deps = 0; $which_must_be_deleted = array(); // Dep/cies from user's above Project $words = array( array('Guest', 'PayPal'), //$words[0]-------------------------------->| //array('DHL', 'Guest') //$words[1]---------------------------------->| // | // | ); // | // | $sum = array(); // | $sum_teliko = array(); // | for ($p=0; $p<sizeof($words); $p++) { // | // | unset($sum); // | $sum = array(); // | echo "$p index of array $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n"; // | for ($i=0; $i<sizeof($people); $i++) { // | // | $var = $people[$i]; // | // | $ch = implode("|",$words[$p]); // <====| I pass the index of each array from the $words[] echo $pattern = '['.$ch.']'; if(preg_match_all($pattern, $var,$matches) >=2) { echo 'Αυτό απορρίπτεται γιατί βρήκα και τα 2....'; $sum[] = $i; //κρατάω τη θέση που βρήκα τις εξαιρέσεις echo "\n"; $which_must_be_deleted[] = $i; $count++; }else { echo 'Περνάει...'; echo "\n"; } } echo "$p index of array $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n"; $sum_teliko[$p] = $sum; echo "\n"; } echo "Dep/ces που πρέπει να αφαιρέσω " .$count ; echo "\n"; print_R($sum_teliko); echo "\n"; sort($which_must_be_deleted); print_R(array_unique($which_must_be_deleted)); // διαγραφω τα dep/cies απο τον αρχικο πινακα με τα test cases foreach ($which_must_be_deleted as $example) { unset($people[$example]); } // εκτυπωνω τα τελικα test cases print_R($people); ?>

preferences:
52.93 ms | 402 KiB | 5 Q