Someone
public php v1 · immutable<?phpclass xpath{ public $id; public $user; public $action; public function parse() { $pagem = $_SERVER['PATH_INFO']; if (preg_match('/(\w+)\:(\w+)[\/]*$/i', $pagem, $matches2)) { $page = $matches2[1]; $this->id = $matches2[2]; $this->user = $matches2[2]; } elseif (preg_match('/(\w+)[\/]{0,1}$/', $pagem, $matches2)) { $page = $matches2[1]; } $this->action = ($page) ? $page : false; return $this->action; }}