print_r($view) function yields:
View Object ( [viewArray:View:private] => Array ( [title] => Projet JDelage ) ) 1 <--------------
What does the “1” at the end mean? The PHP manual isn’t very clear on how to parse the output of
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.
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).