How to call this function with url parameter
function test($str, $str_){
if ($str == $str)
echo "null";
else
echo "helloworld";
}
How to call this function with url parameter
function test($str, $str_){
if ($str == $str)
echo "null";
else
echo "helloworld";
}
Use this:
switch($_GET['cmd']) {
case 'hello':
test($_GET['cmd'],'second_parameter_value');
}
The problem is that you aren't passing a value for the second parameter. I execute previous code and prints "helloworld"
Second part:
If your intention is to call the function using two parameters in the Url you can use the follow (I'm only modifying the important parts in your own initial code):
function test($str, $str_){
if ($str == "null")
echo "null";
else
echo "helloworld";
}
switch($_GET['cmd']) {
case 'hello':
test($_GET['cmd'],$_GET['cmd2']);
}
and the Url to call this is: execute.php?cmd=hello&cmd2=hello2