try to follow this code
<?php
/**
* Implements hook_menu().
*/
function example_menu() {
// In this example, the third parameter will be passed.
$items['admin/example/%'] = array(
'title' => 'Example of first parameter being passed',
'description' => 'This has a page arguments index of two because the wildcard occurs at the 3rd parameter',
'page callback' => 'one',
'page arguments' => array(2),
'access arguments' => array('access administration pages'),
);
// The third and fourth parameters are being passed, hence we need to create an array with values 2 and 3 for the page arguments key
$items['admin/example/%/%'] = array(
'title' => 'Example of multiple parameters being submitted',
'description' => 'Example of multiple parameters being submitted',
'page callback' => 'two',
'page arguments' => array(2, 3),
'access arguments' => array('access administration pages'),
);
return $items;
}
/**
* One parameter being passed.
*/
function one($one) {
return $one;
}
/**
* Two parameters being passed.
*/
function two($one, $two) {
return $one . ' ' . $two;
}
Thank You.