You are here: Funky array question « PHP « IT news, forums, messages
Funky array question

Posted by Brian Dunning on 10/07/63 11:29

I want to create an array like this:

$myArray=array(
array('orange','A very bright color'),
array('blue','A nice color like the ocean'),
array('yellow','Very bright like the sun') ...etc...
)

Sort of like a small database in memory. Then I want to compare each
of the rows coming out of a MySQL call, which are sentences, against
this array to see if the FIRST TERM in each array element is present
in the sentence, and then display the SECOND TERM from the array for
each sentence. Make sense? So for these two sentences, and the above
array, here's how I want it to output:

"He used blue paint" - A nice color like the ocean.
"The flower was yellow" - Very bright like the sun.

Can someone help me out with the code needed to search the sentence
to which FIRST TERM appears in it, and retrieve the SECOND TERM? I've
tried too many things and now my brain is tied in a knot.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация