Initial commit
This commit is contained in:
41
_old/version_2/php/func_ops.php
Executable file
41
_old/version_2/php/func_ops.php
Executable file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
#####################################################
|
||||
# #
|
||||
# written by benjamin ramey #
|
||||
# ben.ramey@gmail.com #
|
||||
# #
|
||||
# best viewed with: #
|
||||
# resolution = 1280x960 #
|
||||
# tab = 4 spaces #
|
||||
# indent = 8 spaces #
|
||||
# #
|
||||
# This file contains: #
|
||||
# Functions the govern various and sundry #
|
||||
# site operations such as obtaining the #
|
||||
# commands sent to the server like, for #
|
||||
# example, what page to display #
|
||||
# #
|
||||
#####################################################################################################################
|
||||
# CODE # COMMENTS #
|
||||
#####################################################################################################################
|
||||
|
||||
##################################################################### FUNCTION: ops_get_cmds
|
||||
function ops_get_cmds()
|
||||
{
|
||||
global $_QUERY,$_SCRIPT_NAME;
|
||||
$separator = '/'; # query string will be split by this character
|
||||
$cmds = array();
|
||||
|
||||
if(empty($_QUERY)) { return($cmds); } # if the query string is empty, no need to procede
|
||||
# but we do want to still return an array (even an empty one)
|
||||
$cmds = explode($separator,
|
||||
str_replace($_SCRIPT_NAME,'',$_QUERY));
|
||||
for($c = 0; $c < count($cmds); ) { # removes any empty array elements
|
||||
if(empty($cmds[$c])) {
|
||||
array_splice($cmds,$c,1); # remove the empty element
|
||||
}
|
||||
else { $c++; } # only advance the array index if we didn't splice something out
|
||||
}
|
||||
|
||||
return($cmds);
|
||||
}
|
||||
Reference in New Issue
Block a user