Skip to content

Instantly share code, notes, and snippets.

@katsube
Created October 15, 2022 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katsube/7d98dbae79e7eae90391b0558819197d to your computer and use it in GitHub Desktop.
Save katsube/7d98dbae79e7eae90391b0558819197d to your computer and use it in GitHub Desktop.
<?php
$items = [18, 15, 30, 17, 25];
$max = $items[0];
// 一番大きな値を探す
for($i=1; $i<count($items); $i++){
// ★ここを回答する
}
// 結果を表示
echo $max; // 30と表示される
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment