[PHP] Funky array question

2005-10-16 Thread Brian Dunning
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

Re: [PHP] Funky array question

2005-10-16 Thread Minuk Choi
Assuming that you are also accepting partial matches... (e.g. if you had a sentence with something like, Mr. LeBlue says hello, and that should be a match for blue) If $mysqlString contains 1 sentence from the mySQL database(I assume you've a loop or something that'll fetch 1 string per

Re: [PHP] Funky array question

2005-10-16 Thread Jordan Miller
Hello, what have you been trying for comparison so far that has not been working? if you have php 5, you would want to use stripos, which is case- INsensitive, not strpos, which is the opposite. Also, note the warning on the man page. you would want to use a triple equals sign !===false

Re: [PHP] Funky array question

2005-10-16 Thread Jordan Miller
sorry, I am mistaken here. I forgot that !== is the same functionality as a ===, in that the comparison is made by value *and* type. On Oct 16, 2005, at 11:26 PM, Jordan Miller wrote: Also, note the warning on the man page. you would want to use a triple equals sign !===false because

Re: [PHP] Funky array question

2005-10-16 Thread Jordan Miller
one more thing... if you have php 5 and = 3.0.6, you could use stristr for case insensitive comparison without having to deal with the slower and more cumbersome regex. On Oct 16, 2005, at 11:18 PM, Minuk Choi wrote: Assuming that you are also accepting partial matches... (e.g. if you