Tim,
As Leatherback stated we should be more worried about determining which picture to correctly display. Allowing the user to select which set of images to display would be the best course of action but from what I understand, this is not an option.
Going with the static array idea I came up with the following UNTESTED code:
// Define the boy and girl comparison array
// Words taken from the following URL's:
// http://thesaurus.reference.com/browse/girl
// http://thesaurus.reference.com/browse/boy
$aBoy = array("buck", "cadet", "chap", "child", "chip", "dude", "fellow", "gamin", "guy", "half-pint", "junior", "lad", "little guy", "master", "punk", "puppy", "runt", "schoolboy", "shaveling", "shaver", "small fry", "sonny", "sprout", "squirt", "stripling", "tadpole", "whippersnapper", "youngster", "youth");
$aGirl = array("babe", "baby doll", "bird", "blonde", "bobby-soxer", "boytoy", "broad", "butterfly", "canary", "chick", "coed", "cupcake", "cutie", "dame", "damsel", "daughter", "deb", "debutante", "doll", "female", "filly", "gal", "jail bait", "lady", "lassie", "mademoiselle", "maid", "maiden", "minx", "miss", "missy", "mouse", "nymph", "nymphet", "piece", "queen", "schoolgirl", "she", "sis", "skirt", "spring chicken", "teenybopper", "tomato", "tomboy", "virgin", "wench", "witch", "woman");
// Break up the title so we can search through each word
$aTitle = explode(" ", $info['title']);
// Define the default value
$bFound = false;
// Random image number
$num=rand(1,50);
// Go through each word in the title and see if the word is found
// within the boy and girl array.
foreach($aTitle as $sWord) {
if(in_array($sWord, $aBoy) || in_array($sWord, $aGirl)) {
$bFound = true;
break;
}
}
// If the word is found then we know we have to display a children
// based image or just a general one
if($bFound)
echo "<img src=images/children/picture$num.jpg align=left>";
else
echo "<img src=images/general/picture$num.jpg align=left>";
This should get you started without having to programmatically implement a thesaurus. Granted, you will have to add/remove words from the search arrays.