rendered paste body<?php// Function getPathElements// { // Name: getPathElements // Args: array getPathElements() // Desc: Returns an array over the processed path. // BeginCode function getPathElements() { // Get the raw data. $path = $_GET['r']; if((empty($path)) === true) $path = 'index'; // Remove unwanted chars. if($path[0] == '/') $path = ltrim($path, '/'); $last = (strlen($path) - 1); if($path[$last] == '/') $path = rtrim($path, '/'); // Make the string to an array. $path = explode('/', $path); // Check all the route one more time. foreach($path as $test) { if(preg_match('/[a-zA-Z0-9.+_-]+/', $test) == 1) $paths[] = $path[$i]; } return $paths; } // EndCode// }?>