Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. $segment = $this->uri->segment(2); //obter o segmento
  2. preg_match("/#([0-9]*)/", $segment, $matches); //isolar o id
  3. $id = !empty($matches[1]) ? (int) $matches[1] : null; // verificar se este existe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement