Result of var_dump($_POST['pass_field']) is a bunch of dashes?
Question
Greetings,
I am trying to debug a login script. So I decided to use var_ dump to print out the password. But for some reason say If I type in 'BOSTON' rather then printing 'BOSTON' it prints out six dashes, 1 dash for each character. I haven't encountered it like this before. I'm sure i'm missing something. I tried ob_ start() var_ dump then ob_ get_clean but it doesn't print anything that way. I thank the community in advance.
var_dump($_POST['pass_field']); // password BOSTON
output:
string(6) "------"
Solution
I would use the print_r
function on the $_POST
array to see if the pass_field key is set to BOSTON
print_r($_POST);
If you want to use ob_start(), you must get the content then end it
ob_start();
var_dump($_POST['pass_field'];
print_r($_POST);
$content = ob_get_contents();
ob_end_clean();
echo $content;
I hope that helps.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow