Jump to content

levivel

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by levivel

  1. sorry, I didn't mention the other important part of the story: I ran that array through array_diff to compare it with another array, and the output is actually the result of the arraydiff function. What I wanted to do was remove the elements from the first array that also appeared in the second array. $rateSentences[] = array_diff($allSentences,$subjectSentences); $subjectSentences is pulled the same way as allSentences in my first post. The output in my first post is a print_r of $rateSentences.
  2. I'm trying to pull out a list of id's into a simple array, but I seem to be getting is a multidimensional array. All I need is a simple array with the list of id's. What am I doing wrong? //Get list of all sentence id's selected for test in database $allSentenceQuery = mysql_query("SELECT id FROM associations WHERE validate='checked'") or die("First Query: ".mysql_error()); while ($allSentenceResult = mysql_fetch_array($allSentenceQuery)){ $allSentences[] = $allSentenceResult['id']; //echo "allSentences: ".$allSentenceResult['id']; } And what I get: "Array ( [0] => Array ( [1] => 2 [2] => 3 etc...." Thanks for your help!
  3. works beautifullly, thank you kindly L
  4. Hello, I would like to ask for your kind assistance in this difficulty: I merged two arrays in one. In this merged array, there will be duplicate values. I would like to take those duplicate values and remove them - both, not only the duplicate value, but the original too. At the end, I would like to end up with an array with only values that did not have a duplicate after the merge. I've been searching for a solution, but this issue seems very similar to removing only the duplicate value and all my results seem to point me to the array_unique function, which does not do what I would like to. I appreciate any suggestions. Thanks, L
  5. wow thank you - I'll get right on this
  6. Hello, My task is to read a list of values from MySQL, compare it to a list from an array, ignore the values that exist both in the MySQL list and the array list, and select a random value from the remaining array. I've found functinos like array_slice, array_rand, multisort_array, but I can't seem to be able to put together the whole picture. Could anyone point me in the right direction? Thanks very much, Levi
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.