This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ISBN13をISBN10に変換する関数。 | |
* | |
* Usage | |
* console.log(isbn13to10("9784063842760")); | |
* > "4063842762" | |
* | |
* # 変換ロジックの解説(例:"9784063842760") | |
* 1. ISBN13の先頭3文字と末尾1文字を捨てる => "4063842760" | |
* 2. 4*10 + 0*9 + 6*8 + 3*7 + 8*6 + 4*5 + 2*4 +7*3 + 6*2 = 218 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//write kazua | |
function convGtJDate($src) { | |
list($year, $month, $day) = explode('/', $src); | |
if (!@checkdate($month, $day, $year) || $year < 1869 || strlen($year) !== 4 | |
|| strlen($month) !== 2 || strlen($day) !== 2) return false; | |
$date = str_replace('/', '', $src); | |
if ($date >= 19890108) { | |
$gengo = '平成'; |