Re: Globals or Super Global Variables To Be Reused from For Loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
[/snip]

Alice,

The big problem here is that you are resetting the $string3 variable in the
loop

  for ($j=0; $j<$count_chunk2; $j++) {

         $string3= $stringChunk2[$j];                //  <<<------ resetting
the value
     if ($j <$count_chunk_2) {
        $string2= " OR ";
        $string3=$string3.$string2;
  }
    else {
        //Don't do anything
  }
      echo $string3;
 }


I am not sure of your goal since you have not stated it, but it certainly
should be easier to just replace the PIPE  with the OR

$message = str_replace("|", " OR ", $message);



-- 

Bastien

Cat, the other other white meat

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux