随机字选择 [英] Random word selection

查看:227
本文介绍了随机字选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以将在线词典(如dictionary.com)中的随机单词变成一个用于 PHP 的字符串。 API 等...

Is there a way to get a random word from an online dictionary like dictionary.com, into a string for use in PHP. API's etc...

不可能吗?

推荐答案

检查这个事情 http://www.ypass.net/misc/dictionary/random-word-widget.html
它的源代码也是可以的。

Check this thing out http://www.ypass.net/misc/dictionary/random-word-widget.html. The source code it avaiable as well.

你最好从 ASPELL http://sourceforge.net/projects/wordlist/ ,将它们导入到数据库表中,并在每次加载页面时随机选择一个。将会比API调用更快。

You are better of getting list of words from ASPELL or http://sourceforge.net/projects/wordlist/, importing them into a db table and randomly selecting one every time page loads. Will be faster than an API call, for sure.

这篇关于随机字选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆