/**
  * getSelectedChildSections - gets all selected child sections from the given parentsection
  * 
  * @param string	$parentsection the parentsection
  * 
  * @return array all child sections from the parent section the user wants to search in
  */
 function getSelectedChildSections($parentsection)
 {
     $sections = array();
     $postArray = _getPostArray();
     foreach ($postArray as $key => $value) {
         if (substr($key, 0, strlen($parentsection)) == $parentsection) {
             if (strlen(substr($key, strlen($parentsection), strlen($key))) > 0) {
                 array_push($sections, urldecode(substr($key, strlen($parentsection), strlen($key))));
             }
         }
     }
     return $sections;
 }
Example #2
0
/**
 * getStringFromPost - get a string from POST
 *
 * @param string $key key of the wanted value
 * @param string $defaultValue if we can't find the wanted value, it returns the default value
 * @return string the value
 */
function getStringFromPost($key, $defaultValue = '')
{
    return _getStringFromArray(_getPostArray(), $key, $defaultValue);
}