0

The codeigniter uri string value with hypen was replaced with underscore in query.

For example : http://domain.com//demo1/index.php/class/method/test-product

The URI : test-product was passed into the query with test_product , so the value is empty in the query result.

How to avoid this problem

1
  • You can use use $this->uri->segment(3) if it is always test-product. It will not make any difference what ever you do with test-product Commented Nov 25, 2013 at 8:46

2 Answers 2

1

Use URI Class to get the uri segment value like this way:

$this->uri->segment(n);

here $this->uri->segment(3) will return test-product

Sign up to request clarification or add additional context in comments.

Comments

0

You can convert it

$data = str_replace('_','-',$data);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.