What does "1" mean at the end of a php print_r statement?

Solution 1:

You probably have echo print_r($view). Remove the echo construct. And... what need do you have to parse its output? There are certainly much better ways to solve your problem.

Solution 2:

print_r called with one argument (or with its second argument set to false), will echo the representation of its parameter to stdout. If it does this, it returns TRUE. Thus if you echo print_r($foo) you will print the contents of foo, followed by a string representation of the return value (which is 1).