The PHP extension that is associated with the WordNet site is very outdated and outdated - it claims to work with PHP4, so I don't think it has been viewed for years.
There are no other APIs for WordNet-> PHP, so I implemented my own solution.
WordNet can be run from the command line, so the PHP function shell_exec() can read the result.
If you start WordNet from the command line (cd into the Wordnet directory, and then just wn ) without any parameters, it will show you a list of possible functions that Wordnet supports.
On the command line, if you then try one or some of these functions, you will see how Wordnet displays its results. For example, if you want to use synonyms for the word "star", you can try the -synsn function:
wn star -synsn
This will produce a result that looks something like this:
Synonyms / Hypermin (ranked by estimated frequency) of a noun
8 senses of the star
Feeling 1 star => heavenly body, heavenly body
Sense 2 ace, adept, champion, sensation, maven, mavin, virtuoso, genius, hotshot, star, superstar, whiz, whiz, wizard, wiz => expert
Feeling 3 stars => heavenly body, heavenly body
Feeling 4 stars => planar figure, two-dimensional figure
The feeling of 5 stars, most importantly, leadership => actor, histrion, player, thespian, role player
Sense 6 headliner, star => performer, performer
Feeling 7 asterisk, star => symbol, grapheme, graphic symbol
Sensitivity 8-star topology, star => topology, network topology
In PHP, you can read the same output using the shell_exec() function.
$result = shell_exec('/path/to/wn '.$word.' -synsn');
Now $result should contain the block of text indicated above.
At this point you need to do the right coding. You will need to take this block of text and analyze it for the required data.
That's where it gets complicated. Since the data is presented in a format intended for human reading, and not a program, it is difficult to accurately analyze.
It is important to note that different search options present their conclusion in a slightly different way. And some results that return may be somewhat esoteric. I ended up writing a weighing system to score the results, but it was quite specific to my needs, so you need to experiment with it to create your own system.
I hope you have enough help. :)