08-26-2008, 02:48 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Jan 2008
Posts: 24
Thanks: 13
|
Cleaning results from dict://dict.org/
I have implemented a dictionary search using the DICT protocol (dict://). The search-results are unformatted and I'm trying to clean them up.
I.e., the results retrieved from dict://dict.hewgill.com/ can be trimmed with this simple code:
PHP Code:
$results = explode("\"en.wiktionary.org (brief)\"", $string); $new_string = $results[1];
This does away with the first part but leaves me with some stuff at the end, that I would want to cut off as well. Everything I have tried using "$new_string" in the further process has failed, always returning an empty string.
For a closer look at what the returned results look like, try a dictionary search on Boldeagle's Lifestream - Always in search of spinless (not 'spineless') information (search for "freedom" i.e.).
Some regex experts here perhaps who could help?
Last edited by sidisinsane : 08-26-2008 at 02:50 PM.
Reason: Added link
|
|
|
|