3v4l.org

run code in 300+ PHP versions simultaneously
<?php $p = array( 'test' => 7, 'checkbox_2' => 'on', 'checkbox_4' => 'on', 'checkbox_10' => 'on', 'Submit' => '', 'name' => 20, ); foreach ($p as $key => $val) { //if (substr($key, 0, strlen('checkbox_')) == 'checkbox_') { if (strpos($key, 'checkbox_') === 0) { echo substr($key, strlen('checkbox_')) . PHP_EOL; } }

preferences:
39.42 ms | 402 KiB | 5 Q