Re: comparing string data with database data

From: Date: Sat, 24 Aug 2002 22:07:54 +0000
Subject: Re: comparing string data with database data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113980@lists.php.net to get a copy of this message
split your string into an array using the explode() function. Then walk through your new array and compare each value to your database value. You can use the foreach statement to do this. /dkm ----- Original Message ----- From: <rdkurth@starband.net> To: "php-general" <php-general@lists.php.net> Sent: Saturday, August 24, 2002 5:47 PM Subject: [PHP] comparing string data with database data > > Can somebody help me with this or point me in the right direction. > an example of what i need > I have a string that has 4 items in it separated by a space > $string="item1 item2 item3 item4"; > I also have a database with a lot of other items in it. > > I what to compare the items in the string with the items in the > database and if any of them match to branch of and do something > different with the data. if they don't match do something else with the > data. I hope this makes sense > > > > > > > -- > Best regards, > rdkurth mailto:rdkurth@starband.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#113980) next »