This wont echo the vars
<?php
function myfunc(){
function gettime(){
$date = date('d-m-y h:i:s');
global $date;
}
function getURL(){
$url = $_SERVER['REQUEST_URI'];
global $url;
}
function getrequest(){
$method = $_SERVER['REQUEST_METHOD'];
$request = explode("/", substr(@$_SERVER['PATH_INFO'], 1));
switch ($method) {
case 'PUT':
$requestmethod = 'GET';
break;
case 'POST':
$requestmethod = 'POST';
break;
case 'GET':
$requestmethod = 'GET';
break;
default:
$requestmethod = 'unkown';
break;
}
global $requestmethod;
}
}
myfunc();
echo $requestmethod.$url.$date;
How can I get $date
(and all others) to echo
their values?
I set them to Global
, and even if I put echo
inside of the function, it still didn't work.