e.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. $entries = array(
  3. 'EAVESDROP' => array(
  4. 'part' => 'v.i.',
  5. 'definition' => 'Secretly to overhear a catalogue of the
  6. crimes and vices of another or yourself.',
  7. 'quote' => array(
  8. 'A lady with one of her ears applied',
  9. 'To an open keyhole heard, inside,',
  10. 'Two female gossips in converse free &mdash;',
  11. 'The subject engaging them was she.',
  12. '"I think," said one, "and my husband thinks',
  13. 'That she\'s a prying, inquisitive minx!"',
  14. 'As soon as no more of it she could hear',
  15. 'The lady, indignant, removed her ear.',
  16. '"I will not stay," she said, with a pout,',
  17. '"To hear my character lied about!"',
  18. ),
  19. 'author' => 'Gopete Sherany',
  20. ),
  21. 'EDIBLE' => array(
  22. 'part' => 'adj.',
  23. 'definition' => 'Good to eat, and wholesome to digest, as
  24. a worm to a toad, a toad to a snake, a snake to a pig,
  25. a pig to a man, and a man to a worm.',
  26. ),
  27. 'EDUCATION' => array(
  28. 'part' => 'n.',
  29. 'definition' => 'That which discloses to the wise and
  30. disguises from the foolish their lack of
  31. understanding.',
  32. ),
  33. 'ELOQUENCE' => array(
  34. 'part' => 'n.',
  35. 'definition' => 'The art of orally persuading fools that
  36. white is the color that it appears to be. It includes
  37. the gift of making any color appear white.',
  38. ),
  39. 'ELYSIUM' => array(
  40. 'part' => 'n.',
  41. 'definition' => 'An imaginary delightful country which
  42. the ancients foolishly believed to be inhabited by the
  43. spirits of the good. This ridiculous and mischievous
  44. fable was swept off the face of the earth by the early
  45. Christians &mdash; may their souls be happy in Heaven!',
  46. ),
  47. 'EMANCIPATION' => array(
  48. 'part' => 'n.',
  49. 'definition' => 'A bondman\'s change from the tyranny of
  50. another to the despotism of himself.',
  51. 'quote' => array(
  52. 'He was a slave: at word he went and came;',
  53. 'His iron collar cut him to the bone.',
  54. 'Then Liberty erased his owner\'s name,',
  55. 'Tightened the rivets and inscribed his own.',
  56. ),
  57. 'author' => 'G.J.',
  58. ),
  59. 'EMOTION' => array(
  60. 'part' => 'n.',
  61. 'definition' => 'A prostrating disease caused by a
  62. determination of the heart to the head. It is
  63. sometimes accompanied by a copious discharge of
  64. hydrated chloride of sodium from the eyes.',
  65. ),
  66. 'ENVELOPE' => array(
  67. 'part' => 'n.',
  68. 'definition' => 'The coffin of a document; the scabbard
  69. of a bill; the husk of a remittance; the bed-gown of a
  70. love-letter.',
  71. ),
  72. 'ENVY' => array(
  73. 'part' => 'n.',
  74. 'definition' => 'Emulation adapted to the meanest
  75. capacity.',
  76. ),
  77. 'EPITAPH' => array(
  78. 'part' => 'n.',
  79. 'definition' => 'An inscription on a tomb, showing that
  80. virtues acquired by death have a retroactive effect.
  81. Following is a touching example:',
  82. 'quote' => array(
  83. 'Here lie the bones of Parson Platt,',
  84. 'Wise, pious, humble and all that,',
  85. 'Who showed us life as all should live it;',
  86. 'Let that be said &mdash; and God forgive it!',
  87. ),
  88. ),
  89. 'EVANGELIST' => array(
  90. 'part' => 'n.',
  91. 'definition' => 'A bearer of good tidings, particularly
  92. (in a religious sense) such as assure us of our own
  93. salvation and the damnation of our neighbors.',
  94. ),
  95. );
  96. if (isset($entries[strtoupper($_REQUEST['term'])])) {
  97. $term = strtoupper($_REQUEST['term']);
  98. $entry = $entries[$term];
  99. echo build_entry($term, $entry);
  100. } else {
  101. echo '<div>Sorry, your term was not found.</div>';
  102. }
  103. function build_entry($term, $entry) {
  104. $html = '<div class="entry">';
  105. $html .= '<h3 class="term">';
  106. $html .= $term;
  107. $html .= '</h3>';
  108. $html .= '<div class="part">';
  109. $html .= $entry['part'];
  110. $html .= '</div>';
  111. $html .= '<div class="definition">';
  112. $html .= $entry['definition'];
  113. if (isset($entry['quote'])) {
  114. $html .= '<div class="quote">';
  115. foreach ($entry['quote'] as $line) {
  116. $html .= '<div class="quote-line">'. $line .'</div>';
  117. }
  118. if (isset($entry['author'])) {
  119. $html .= '<div class="quote-author">';
  120. $html .= $entry['author'] .'</div>';
  121. }
  122. $html .= '</div>';
  123. }
  124. $html .= '</div>';
  125. $html .= '</div>';
  126. return $html;
  127. }