Hello, here is the PHP situation I'm in. I'll type it out in pseudo-ish code first.
<?php
$multi_array = array(
array("cats", "dogs", "sheep", "walruses"),
array("jazz", "larva", "pencils", "derp"),
array("to", "much")
);
$string = array("the", "cats", "ate", "too", "many", "pencils");
$count = count($string);
for($i = 0; $i < $count; ++$i) {
if($string[$i] IN ARRAY $multi_array) {
THEN replace $string[$i] with a random word in the sub array of the multi-array
for example, if $string[$i] is cat, then it would replace it with any of the words in the sub array of multi-array, so it could be "cats", "dogs", "sheep", or "walruses"
}
}
?>
I have no idea how to do this and tried thinking of ways for an hour and a half.