I wanted to format some output using printf, but it outputs a number after each item for some reason. Any ideas as to why this is and how it could be fixed?
$array = array("Mo" => "09:30-19:00",
"Di" => "09:30-19:00",
"So" => "geschlossen");
foreach( $array as $key => $value ){
echo printf("%3s:%15s", $key, $value);
}
output
Mo: 09:30-19:0019 Di: 09:30-19:0019 So: geschlossen19
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…