<?php include("include/function.php"); //取得亂數 $handn= rand(1,3); //echo $handn; //設定檔名 if ($handn == 1){ $hand = "scissors.png"; }elseif($handn == 2){ $hand = "rock.png"; }elseif($handn == 3){ $hand = "paper.png"; } //到正確的地方去 echo 檔名即可 //echo $hand; ?>