ultrus Posted June 24, 2008 Share Posted June 24, 2008 Hello, I'm troubleshooting data coming in from $_POST, and am thinking it would be nice to list the variable keys and values. I can do this using print_r(), but in this case I need to assign the keys and values to a string then email it to me instead this time. How would I do this? If I figure this out first, I'll post the answer. Thank you much! Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 24, 2008 Share Posted June 24, 2008 Are you just looking for something like: $string = print_r($_POST,true); or $string = ""; foreach($_POST as $key=>$value) $string .= "{$key}: $value\n"; Quote Link to comment Share on other sites More sharing options...
craygo Posted June 24, 2008 Share Posted June 24, 2008 foreach($_POST as $key => $val){ $array[] = "Key:$key = Value: $val"; } $string = implode(", ", $array); Ray Quote Link to comment Share on other sites More sharing options...
ultrus Posted June 24, 2008 Author Share Posted June 24, 2008 Oh wow. I'm off today. That was easy... and just what I needed! Thanks for the awesome and super fast feedback. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.