Pregunta

i want show array without []=> mycod is

foreach ($results as  $value=>$value2){  //for array $ resullt is array        
            $array2=print_r($value2);
           return true;

       }


Array ( [0] => test [1] => test [2] => test [3] => test [4] => test)
¿Fue útil?

Solución

Try this:

echo implode("", $array);

Otros consejos

Don't use print_r then, or var_dump for that matter. Just set $array2 = $value2;

To only echo the values you can do this:

foreach ($results as  $key=>$value){  //for array $ resullt is array        
      echo $value . "<br />";
   }

you can not have array without keys.

you can access array elements by looping through it and can create formatted output. like this:

$strOutput = "";
foreach ($results as  $value=>$value2){      
            $strOutput .= $value2 ." ";
       }
echo $strOutput;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top