【php开源代码栏目提醒】:网学会员为需要php开源代码的朋友们搜集整理了completer.php相关资料,希望对各位网友有所帮助!
<?php
$people = array(
"Abraham Lincoln",
"Adam Smith",
"Adolf Hitler",
"Albert Einstein",
"Alexander Fleming",
"Alexander Graham Bell",
"Alexander Hamilton",
"Alexander the Great",
"Alfred T. Mahan",
"Antoine Laurent Lavoisier",
"Antony van Leeuwenhoek",
"Archimedes",
"Aristotle",
"Ashoka",
"Atahualpa",
"Augustus Caesar",
"Benjamin Franklin",
"Buddha",
"Charlemagne",
"Charles Darwin",
"Cheops",
"Christopher Columbus",
"Confucius",
"Constantine the Great",
"Cyrus the Great",
"Deganawidah",
"Edward Jenner",
"Emperor Wu of the Han",
"Enrico Fermi",
"Ernest Rutherford",
"Euclid",
"Ferdinand Magellan",
"Francis Bacon",
"Francisco Pizarro",
"Franklin D. Roosevelt",
"Galen",
"Galileo Galilei",
"Genghis Khan",
"George Washington",
"Gregor Mendel",
"Gregory Pincus",
"Guglielmo Marconi",
"GWF Hegel",
"Harriet Beecher Stowe",
"Henry David Thoreau",
"Henry Ford",
"Hernando Cortes",
"Homer",
"Isaac Newton",
"James Watt",
"Jean-Jacques Rousseau",
"Jesus Christ",
"Johann Gutenberg",
"Johannes Kepler",
"John Calvin",
"John Dalton",
"John F. Kennedy",
"Joseph Lister",
"Joseph Stalin",
"Julius Caesar",
"Justinian I",
"Karl Marx",
"Lao Tzu",
"Lenin",
"Leonardo da Vinci",
"Leonhard Euler",
"Louis Daguerre",
"Louis Pasteur",
"Ludwig van Beethoven",
"Mani",
"Mao Zedong",
"Marie Curie",
"Martin Luther",
"Mehmed the Conqueror",
"Menes",
"Michael Faraday",
"Michelangelo",
"Mikhail Gorbachev",
"Mohandas Gandhi",
"Montezuma",
"Moses",
"Mother Theresa",
"Muhammad",
"Muhammad Ali",
"Mustafa Kemal Ataturk",
"Napoleon Bonaparte",
"Netzhualcoyotl",
"Niccolo Machiavelli",
"Nicolaus Copernicus",
"Nikola Tesla",
"Oliver Cromwell",
"Orville Wright",
"Peter the Great",
"Plato",
"Pope Urban II",
"Queen Elizabeth I",
"Queen Isabella I",
"Rene Descartes",
"Rosa Parks",
"Russell Means",
"Shih Huang Ti",
"Sigmund Freud",
"Simon Bolivar",
"St. Augustine",
"Sui Wen Ti",
"Tecumseh",
"Theodore Roosevelt",
"Thomas Edison",
"Thomas Jefferson",
"Thomas Malthus",
"Thomas Paine",
"Ts'ai Lun",
"Umar ibn al-Khattab",
"Vasco da Gama",
"Wilbur Wright",
"William Harvey",
"William Shakespeare",
"William T.G. Morton",
"William the Conqueror",
"Willis Haviland Carrier",
"Woodrow Wilson",
"Ziryab"
);
$input = strtolower($_GET['input']);
$inputLen = strlen($input);
if ($inputLen > 0) {
for ($i = 0; $i < count($people); $i++) {
if (strtolower(substr($people[$i], 0, $inputLen)) == $input) {
echo substr($people[$i], $inputLen, strlen($people[$i]) - $inputLen);
break;
}
}
}
?>