Get value from regular expression

babatsa

New Member
I have this regular expression: \[code\]company/(.*)-f(\d+).html$ company/view/$2\[/code\]In view method of company class I use \[code\]$this->uri->segment(3)\[/code\] to get the value of \[code\]$2\[/code\]; I can't understand why can't get the value of $2 just like variable.\[code\]public function view($param){ echo $param; // no value returned $this->uri->segment(3) // works fine}\[/code\]
 
Back
Top