3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tries = array("when what", "why?"); $answers = array("Why", "Why?"); $tries = array("why?", "why"); $answers = array("Why", "Why?"); $tries = array("why?"); $answers = array("Why", "Why?"); print_r($tries); print_r($answers); // $count = 0; foreach ($answers as $key => $value) { if (in_array(strtolower($value),$tries)) { $count++; } } echo "Count is: ".$count; ?>
Output for 4.3.0 - 7.1.0
Array ( [0] => why? ) Array ( [0] => Why [1] => Why? ) Count is: 1