Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

i am adding and and or operators to a search engine i will have hooked
up to my personal bookmarks on my website.  i wanted to get rid of
page_url when i chain the conditions together like

tcl or delphi or sqlite returns: 12 11 4 3

probably the correct thing to do is add the occurrence number together
and omit a url.  so one url is listed with the sum of the occurrence.  
right now i'd be happy with getting rid of the duplicate and having the
occurrence be a little off.  i'll think about tackling accurate
occurrence later.

i think the problem in my code is when i call in_array() it is not
finding the url (EVER).  what i wanted to do is create an array and push
a url onto
this new array every time that url is not found.  if it is found then my
code takes a different action.  this way (i thought) duplicate urls dont
get displayed.

here is my code...thanks for any help.

 $unique = array ('init');
    while($array_cell  = each($ar_merge))
     $current_value = $array_cell[0];
     $current_key = $array_cell[1];
     if ($array_cell[1] !=' ') {


      while ($row = mysql_fetch_array($array_cell[1])) {
          if (in_array($row[0],$unique)) {
          } else {      
              print( "$row[0] $row[1]  </br> ");  
              // store in array



Re: in_array

Quoted text here. Click to load it

if in_array is not matching, you may have hidden characters - try adding a
\n to the end of what you're looking for.  this has worked for me after some
head scratching

Re: in_array

Quoted text here. Click to load it

thanks for the tip about hidden characters.

after too many attempts i decided to hell with it.
i can come back later and mess with explode, implode,
and search functions for strings.  maybe going that route i
will have better luck.  for now it is working and is correct
(just not consolidated enough).

it will be ok.  i'd like to put the site on the web soon.
i can make improvements like this later.

thanks again,

Re: in_array

Quoted text here. Click to load it

thanks Chung .
 i took a look at the link and it looks very promising.
  i have to head to work now but will look into this code
 when i am finished with my shift.

have a good week :-)

Site Timeline