Hm... I tried quite a few variations on this. I can't seem to get any
displayable value out of this function.
function get_current_page_name()
{
$current_page_name = explode(/, $_SERVER['PHP_SELF']);
$current_page_name = $current_page_name[-1];
return $current_page_name ;
}
$errorcode =
Do you not have to make $_SERVER a global variable in the function ?
Alastair
Lightwood Consultancy Ltd
Hm... I tried quite a few variations on this. I can't seem to get any
displayable value out of this function.
function get_current_page_name()
{
$current_page_name = explode(/,
]
Sent: Thursday, February 14, 2002 10:46 AM
Subject: RE: [PHP] how a function 'return' statement works
Do you not have to make $_SERVER a global variable in the function ?
Alastair
Lightwood Consultancy Ltd
Hm... I tried quite a few variations on this. I can't seem to get any
displayable
Erik,
function get_current_page_name()
{
$current_page_name = explode(/, $_SERVER['PHP_SELF']);
$current_page_name = $current_page_name[-1];
return $current_page_name ;
}
$errorcode = get_current_page_name();
echo $errorcode;
The only thing that works is $errorcode =
How about:
return $current_page_name[count($current_page_name)-1];
-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Can anyone give my puny mind an explanation as to why the following
function only returns the value Array ?
#
On Thu, 2002-02-14 at 07:32, Erik Price wrote:
Hm... I tried quite a few variations on this. I can't seem to get any
displayable value out of this function.
function get_current_page_name()
{
$current_page_name = explode(/, $_SERVER['PHP_SELF']);
$current_page_name =
On Thursday, February 14, 2002, at 10:46 AM, Alastair Battrick wrote:
Do you not have to make $_SERVER a global variable in the function ?
$_SERVER is global AFAIK, but good thinking. All $_* variables are
global (unlike the $HTTP_*_VARS arrays).
Erik
Erik Price
Web Developer
On Thursday, February 14, 2002, at 02:32 PM, Lars Torben Wilson wrote:
I think what you're trying to do is return one particular element out
of the
array. If that's the case, just use something like:
return $current_page_name[-1]
to return the last element in the array.
I do not know
Can anyone give my puny mind an explanation as to why the following
function only returns the value Array ?
# ===
# get_current_page_name()
# ---
# Returns the current
Price [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 3:56 PM
To: PHP
Subject: [PHP] how a function 'return' statement works
Can anyone give my puny mind an explanation as to why the following
function only returns the value Array
-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 2:56 PM
To: PHP
Subject: [PHP] how a function 'return' statement works
Can anyone give my puny mind an explanation as to why the following
function only returns the value Array
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Wednesday 13 February 2002 22:55, Erik Price wrote:
Can anyone give my puny mind an explanation as to why the following
function only returns the value Array ?
# ===
#
12 matches
Mail list logo