There is no "magic" built-in function in PHP to do that. Depending on how your application is structured, you can either save form data to [man]session[/man] data, then if it exists grab it from there to pre-fill the form; or if using a single page for both form display and processing, just grab the values from the $GET or $POST array, as applicable, e.g.:
<input type='text' name='example' value='<?php
if(isset($_POST['example']))
{
echo htmlentities($_POST['example'], ENT_QUOTES);
}
?>' size='20' maxlength='20'>
And of course you could put that into a function to minimize the typing (and typos).
I suspect there are some 3rd party classes/functions out there for HTML form handling that may automate that sort of thing, but I haven't bothered to look for any, myself.