- printf: documentation ( source)
<?php
$clock = [21,22,23,24,0,1,2,3,4,5,6,7,8];
foreach($clock as $hour){
$larger = $hour >= 21 ? 'yes' : 'no' ;
$smaller = $hour <= 8 ? 'yes' : 'no' ;
printf("is %s larger then 21: %s - is %s smaller then 8: %s\n", $hour, $larger, $hour, $smaller);
}