Grabbing variable from a function
Posted: Mon Aug 29, 2005 1:10 pm
Hello, I'm using this function
To grab the part of the current url that I need. The print line prints out the part I want just fine.
My question is, how can I use that extracted part as a variable to use in a sql queiry?
I tried $nm = substr($path,$position); but $nm is empty.
Thanks.
Code: Select all
function current_dir()
{
$path = dirname($_SERVER[PHP_SELF]);
$position = strrpos($path,'/') + 1;
print substr($path,$position);
}
substr($path,$position);My question is, how can I use that extracted part as a variable to use in a sql queiry?
I tried $nm = substr($path,$position); but $nm is empty.
Thanks.