This question already has an answer here:
How can I use a variable from PHP on tags HTML inside of an array?
$row[] = '<a class="btn btn-round btn-info btn-icon btn-sm edit" href="contenidoFormula" onclick="mostrar('."'".$FORMULA->id_formula."'".')"><i class="fas fa-search-plus"></i></a>
Instead of using onclick's JS function I want to use a PHP function with the same parameter, how can I do that?
</div>
$row[] = "<a class='btn btn-round btn-info btn-icon btn-sm edit' href='contenidoFormula' onclick='mostrar(\"{$FORMULA->id_formula}\")'><i class='fas fa-search-plus'></i></a>";
given function: mostrar() is a javascript function. If it's PHP, then I'm not sure what you're trying to achieve.