Jump to content
Ciffy

Commenting out an echo statement causes my code to error 500! HALP!

Recommended Posts

  foreach($text as $key => $value) {
	echo "test";
	echo "value: " . $value .  "<br />";  
	$tab=explode("\t", trim($value));
        echo "<br />" . $tab[0] . $tab[$i1] . $tab[$i2] . $tab[$i3] . $tab[$i4] . $tab[$i5]. "<br />";
...

So this snippet is driving me mad. 

 

I'm trying to clean up some code that I've been working on in order to move on to the next segment. When I comment out the "echo value . $value" line, the whole thing 500's on me. I added in the echo test statement just to see if there was something weird going on with the open brace in the foreach statement. Does anyone have any idea why this would be acting this way.

 

More code available upon request, but literally all I'm doing in between saves is adding a // in front of the word echo (I've tried at the very front of the line as well as directly in front of the e in echo with the same results).

 

Thanks.

Share this post


Link to post
Share on other sites

Are you developing on a live server? Don't do that. Use a local development environment, make PHP display errors and turn error reporting all the way up. Then you'll actually see what's going on instead of just getting a 500 error.

Share this post


Link to post
Share on other sites

You're trying to echo an array var which is giving you an error - but since you haven't turned on error checking you can't see it. Do as Jacques1 said.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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.