Created
May 8, 2010 15:47
-
-
Save quiptime/394619 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get URI parameter. | |
* | |
* @param string $str | |
* Example to use $str urldecode(drupal_get_destination()). | |
* @return array | |
*/ | |
function _more_node_buttons_get_params($str) { | |
$chunks = explode("?", $str); | |
$params = explode("&", $chunks[1]); | |
$data = array(); | |
foreach ($params as $chunk) { | |
$parts = explode("=", $chunk, 2); | |
if (count($parts) == 2) { | |
list($k, $v) = $parts; | |
$data[$k] = check_plain(urldecode($v)); | |
} | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment