HTML code returned from a function displayed at wrong place

Joe <[email protected]> Mon, 22 May 2023 18:54:15 -0700 (PDT)
Newsgroups comp.lang.php
Message-ID <[email protected]>
I have a php function to return an array of 3 values: 
1- a status code 
2- a small HTML form --OR-- a text string
3- a text string

I am frustrated by the PHP behavior when a HTML form is returned on value 2 of the array - it gets displayed where the function is called, NOT where I tried to place it on latter part of the page.  Any work-around ideas please?

j