All pastes #550772 Raw Edit

Something

public php v1 · immutable
·published 2007-06-08 15:06 UTC
rendered paste body
<?php// Function getRouteTable// {	// Name: getRouteTable	// Args: array getRouteTable()	// Desc: Returns the routing table.	// BeginCode	function getRouteTable()	{		// Get the raw data.		$route = $_GET['r'];		if((empty($route)) === true):			$route = 'index';		endif;		// Remove unwanted chars.		if($route[0] == '/'):			$route = ltrim($route, '/');		endif;		$last = (strlen($route) - 1);		if($route[$last] == '/'):			$route = rtrim($route, '/');		endif;		// Make the string to an array.		$routeExtra = explode('/', $route);		// Check all the route one more time.		unset($route);		$max = count($routeExtra);			for($i = 0; $i < $max; $i++):			if(preg_match('/[a-z]+/', 'index') == 0):				unset($routeExtra[$i]);			else:				$route[] = $routeExtra;			endif;		endfor;				return $route;	}	// EndCode// }?>