0 votes
1.6k views
in General by
Can someone explain me what and why this "1" is displayed at the end of print_r function?

        echo '<pre>'
        echo print_r($validation->getErrorFields());
        echo '</pre>'

1 Answer

0 votes
by
Remove the echo before print_r

the print_r is supposed to return true/false which is displayed as 1 with the echo.

So you only need the following.

        echo '<pre>'
        print_r($validation->getErrorFields());
        echo '</pre>'

Related questions

0 votes
1 answer 683 views
0 votes
2 answers 9.6k views
+2 votes
1 answer 1.2k views
0 votes
1 answer 147 views
asked Aug 19, 2016 in General by Azi Graeber
0 votes
1 answer 643 views
0 votes
1 answer 1.1k views
...