Like this example:
Code: Select all
$name = $_POST['name']; // we'll say the name is Bob
$namesa = mysql_query("SELECT names FROM table WHERE foo = '$bar'");
$names = $namesa['names'];
$array = explode(";",$names); // now I have Array ([0] => Jimmy, [1] => Bob, [2] => Steve)Edit:
After thinking about it, I could do
Code: Select all
$new = array_flip($array);
$key = $array[$name];