3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_array = array(); $my_array['id'] = 4127 ; $my_array['nick'] = 'Jonas'; $my_array['dte79855545'] = 5; foreach ($my_array as $key => $value) { if (substr ( $key , 0 , 3 )=='dte') { $the_dte_id = substr ( $key , 3); $the_dte_value = $value; } } echo "The dte id is:".$the_dte_id." and the value is ".$the_dte_value; ?>

preferences:
41.59 ms | 402 KiB | 5 Q