I'm trying to write a function that will take the querystring variables I pass to it and then format them accordingly. Here's what I have so far...
function getQuerystring($Variable,$Default) {
if ($Variable == "") {
// this is the first problem line because I don't know how to dynamically set the Variable name
$$Variable = "$Default";
} else {
// the second problem line, same reason
$$Variable = trim($Variable);
}
}
It would be called with...
getQuerystring($strSortOrder,"asc");
The first variable would be the querystring element and the second would be the default value.
I know why this isn't working, but I don't know how to write it in php so that it will work. Any ideas?
Thanks,
Wil