• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rewrite url, I can't get id by segment on this url ???

#1
[eluser]memVN[/eluser]
Hello, I have a problem.
my url is http://localhost/ci/category/45
Now I use routes to order rewrite this url follow: http://localhost/ci/category-45
With new url http://localhost/ci/category-45 . I can't get id of category . Who can help me???

#2
[eluser]memVN[/eluser]
Who can help me? , I needing it's to use, thanks for

#3
[eluser]Php Coder[/eluser]
use function explode

Code:
$explode=explode('-',category-45);

$id=$explode[1];
========
category-45
=======
mean your $this->uri->segment(1);

#4
[eluser]memVN[/eluser]
Ok, thanks for Php coder


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.