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 SetHTML() {
$pagetop = "hello this is a title $temptitle goodbye";
$pagebottom = "this is the bottom $temptitle goodbye";
};
And I want to know how to call on it properly. I currently get the $temptitle variable from a MySQL database which has the title of the page. I then call on it so that it can set the variables correctly and the function puts the title that I have already got into the variable for me. When I go to echo $pagetop and $pagebottom outside of the function they are blank. Why is this? Is there something I'm doing wrong?
Thanks in advance,
Matt
Last edited by matth2004 on Sat Nov 11, 2006 4:43 am, edited 1 time in total.
function SetHTML() {
$pagetop = "hello this is a title $temptitle goodbye";
$pagebottom = "this is the bottom $temptitle goodbye";
return array('pagetop' => $pagetop, 'pagebottom' => $pagebottom);
}
Then you can assign the function result to a variable.
Also, you included a ; at the end of your function. Not needed (might be a parse error, not sure).
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.