There is a variable

$content="texttexttexttexttext".$my_content->show_vars(); 

which replaces the {#content} tag inside the block div for displaying content.

  <div class="lg-7">{#content}</div> 

The first part of "texttexttexttexttext" is displayed on the page inside this block, as it should be, and the rest of $ my_content-> show_vars () separately, outside this block, in the upper left corner. Variable $ my_content instance of the content_ class

 class content_{ function show_vars(){ echo "<pre>"; var_dump($_GET); echo "</pre>"; } } 

The text through the variable is displayed normally, and $ my_content-> show_vars () does not want to be displayed in the div either with the text or separately. Why is that?

    1 answer 1

    Because you concatenate a function that does not return, but prints.

    try

      function show_vars(){ $str = "<pre>"; foreach($_GET as $key=>$val) { $str.="$key => $val \n"; } $str.="</pre>"; return $str; } 
    • Thank you, it works that way. And through var_dump it means it is impossible to display? - DoubleClick
    • There is a function called var_export, it can return the result, and not print it - Orange_shadow