PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function varhtml($var1, $var2) {
global $$var1;
$$var1 = htmlentities($var2);
}
varhtml('name', '<b>query1</b>');
echo $name;
That will do what you're trying to do. Horrible way of doing it though. You should be returning the text and assigning it to a variable in the main block.