function GetTitleImgPath(){ $titleImgPath = ""; if (isset($_POST["titlecheckbox"])){ $titleImgPath = $_POST["imgTitlePath"]; //选中了,用isset的方式判断 } return $titleImgPath; }