0

When I try to print this :

   $erros[] = array($divErro1,$divErro2);    
     foreach($erros as $testeste){
     $testeste = array($erros);

using print_r i get the correct values, but with that marker of array "Array ( [0] => Array ( [0] => ...."

How can i get it to print without that marks? I tried echo but it returns the word "Array"

4
  • what exactly do you want it to echo? can you post the output of your print_r() ? Commented May 5, 2011 at 19:46
  • Hi, it prints a DIV. The output is this: Array ( [0] => Array ( [0] => MYDIVHERE [1] => ) ) Commented May 5, 2011 at 19:47
  • @Jason most likely the OP wants a dump of the array, but without the formatting print_r does ([]()=> chars) Commented May 5, 2011 at 20:06
  • @MarcB. Exactly Marc B. that's exactly what I need, could you help me on that? :) Commented May 5, 2011 at 20:27

1 Answer 1

4

Your foreach doesn't look right, try this:

foreach($erros as $testeste) {
     echo $testeste;
}
Sign up to request clarification or add additional context in comments.

6 Comments

Hi @Alix it looks like this because i set the result to another array to display after a series of verifications and displays! :P
@Armando: Are you sure? The foreach seems equivalent to $testeste = end($erros);.
Missing a $ in the echo statement. there's most likely no constant named testeste
Yeap i saw that and fixed before replacing in my code! But I cant get it to work :\
@Armando: I'm sure that if you find the time to post a mockup of what you're trying to output someone could help you with less ambiguity.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.