看板 PHP 關於我們 聯絡資訊
到底為什麼不直接用月判斷? XD $currentMonth = date ('n') // Numeric representation of a month $birthdayTime = strtotime ($birthday); $birthdayMonth = date ('n', $bitrhdayTime); if ($currentMonth == $birthdayMonth // 現在是生日月 || ($currentMonth % 12 + 1) == $birthdayMonth) { // 或下個月是生日月 // 顯示相關資訊 } 另外你說的「在點選時,直接呼叫資料庫中的紀錄顯示,我要的資料」 這我看不太懂,不是就下 SQL 拿東西嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.228.12.244 ※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1516805546.A.996.html