我正在开发一个网页,在该网页上我接受用户输入的单词,当用户提交这些单词时,我想显示这些单词的定义,或者这些单词的维基百科链接以获取有关该单词的更多定义——比如以下:
假设用户输入了 5 个单词:
toast, egg, beans, coffee, tea
现在我想像这样显示它们:
toast › slices of bread that have been toasted
egg › animal reproductive body consisting of an ovum or embryotogether with nutritive and protective envelopes
beans › a small skullcap <link to wikipedia>read more on wikipedia</link>
coffee › a beverage consisting of an infusion of ground coffee beans
tea › a beverage made by steeping tea leaves in water <link to wikipedia>read more on wikipedia</link>
对于那些在 wikipedia 上没有文章的词,不会显示 wiki 链接。
有人可以建议我一些可以为我做这件事的开源 PHP 脚本或包吗?或者,我将不胜感激有关如何在 PHP 中执行此操作的任何建议。
我对直接从其他网站获取数据比在我的数据库中存储单词定义更感兴趣。
我正在使用 PHP 和 MySQL。