Skip to content

Instantly share code, notes, and snippets.

@nitaking
Last active February 15, 2016 09:14
Show Gist options
  • Save nitaking/82b498dbdd51c2547fef to your computer and use it in GitHub Desktop.
Save nitaking/82b498dbdd51c2547fef to your computer and use it in GitHub Desktop.
<?php
// Here your code !
// 出力文字列
$print = "";
$input = trim(fgets(STDIN));
$days = str_replace(array("\r\n","\r","\n"), '', $input);
$days = explode(" ", $days);
// コマンドライン引数処理
for($count = 0; $count < count($days); $count++){
$print .= $days[$count];
// 最後の引数は"/"を付与しない
if ($count < count($days)-1 ) {
$print .= "/";
} else {
$print .= "\n";
}
}
print($print);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment