List Info

Thread: note 61886 added to reserved.variables




note 61886 added to reserved.variables
user name
2006-02-14 17:44:56
Using a combination of magic and a few examples from below
(thank you to those below), the following two functions
should provide the script  with a list (in order) of what is
after the script.

printvars.php:
<?php
function array_compress($array) {
        $aReturn = array();
        foreach ($array as $value)
        if (strlen($value) > 0) { $aReturn[] = $value; }
        return $aReturn;
}

function getPathVariables() {
       $sPathPS = $_SERVER[PHP_SELF];
       $sPathFS = __FILE__;

       $aPathPS = array_reverse(explode("/",
$sPathPS));
       $aPathFS = array_reverse(explode("/",
$sPathFS));

       $aReturn = array();
       $x = 0;

       while ( $aPathPS[$x] != $aPathFS[$x] &&
$aPathPS[$x] != $aPathFS[0] ) {
               array_unshift($aReturn, $aPathPS[$x])       
;
               $x++;
       }

        
       return $aReturn;

}

print_r(array_compress(getPathVariables()));
?>

----
Calling: http://www.website.com/temp/printvars.php/or/
whatever/something.jpg

returns:
Array (
    [0] => or
    [1] => whatever
    [2] => something.jpg
)
----
Server IP: 216.194.113.175
Probable Submitter: 12.47.216.196
----
Manual Page -- h
ttp://www.php.net/manual/en/reserved.variables.php
Edit        -- http://master.php.net/manage/user-notes.php?action=
edit+61886
Delete: added to the manual -- htt
p://master.php.net/manage/user-notes.php?action=delete+61886
&report=yes&reason=added+to+the+manual
Delete: bad code            -- http://master.
php.net/manage/user-notes.php?action=delete+61886&report
=yes&reason=bad+code
Delete: spam                -- http://master.php.
net/manage/user-notes.php?action=delete+61886&report=yes
&reason=spam
Delete: useless             -- http://master.p
hp.net/manage/user-notes.php?action=delete+61886&report=
yes&reason=useless
Delete: non-english         -- http://mast
er.php.net/manage/user-notes.php?action=delete+61886&rep
ort=yes&reason=non-english
Delete: already in docs     -- http://
master.php.net/manage/user-notes.php?action=delete+61886&
;report=yes&reason=already+in+docs
Delete: other reasons       -- http://master.php.net/manage/user-
notes.php?action=delete+61886&report=yes
Reject      -- http://master.php.net/manage/user-
notes.php?action=reject+61886&report=yes
Search      -- http://ma
ster.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

note 61886 deleted from reserved.variables by philip
user name
2007-02-21 09:58:21
Note Submitter: ticklemeozmo at gmail dot com 

----

Using a combination of magic and a few examples from below
(thank you to those below), the following two functions
should provide the script  with a list (in order) of what is
after the script.

printvars.php:
<?php
function array_compress($array) {
        $aReturn = array();
        foreach ($array as $value)
        if (strlen($value) > 0) { $aReturn[] = $value; }
        return $aReturn;
}

function getPathVariables() {
       $sPathPS = $_SERVER[PHP_SELF];
       $sPathFS = __FILE__;

       $aPathPS = array_reverse(explode("/",
$sPathPS));
       $aPathFS = array_reverse(explode("/",
$sPathFS));

       $aReturn = array();
       $x = 0;

       while ( $aPathPS[$x] != $aPathFS[$x] &&
$aPathPS[$x] != $aPathFS[0] ) {
               array_unshift($aReturn, $aPathPS[$x])       
;
               $x++;
       }

        
       return $aReturn;

}

print_r(array_compress(getPathVariables()));
?>

----
Calling: http://www.website.com/temp/printvars.php/or/
whatever/something.jpg

returns:
Array (
    [0] => or
    [1] => whatever
    [2] => something.jpg
)

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )