helper.php
<?php
function h()
{
$randomchar = str_shuffle('abcdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ234567890!$%^&!$%^&');
$password = substr($randomchar, 0, 12);
$generated_pass = $password;
}
view
<input type="text" id="lname" name="pass" value="<?php echo $generated_pass;?>"><br><br>
error ErrorException PHP 8.1.12 9.48.0 Undefined variable $generated_pass
tried to do it like above but got error.