0

how to remove the mark on the picture below? this url to create blog details. I use this php codeigniter language

here's the picture:

3

2 Answers 2

0

If you supposed to remove the string from URL, this may help you.

  • Make the URL as an array by parsing it with parse_url().
  • Extract the portion of your string and then decompose it with parse_str().
  • Remove the parameter with the use of unset.
  • Now build the your URL with http_build_query().

This will give you the URL which you supposed to do.

Other way:

If you want to go with that URL by optimizing it, use routes functionality of CodeIgniter. Check this below.

Path: application/config/routes.php/

$route['your_url_string'] = 'blog/detail';
Sign up to request clarification or add additional context in comments.

Comments

0

add like this

In application/config/ruotes.php

$route['(.*)'] = 'YourController/YourMethod'; // example 'blog/detail'

In Your Controller - I guess Blog is a controller and detail is the method

class Blog extends CI_Controller{
    public function __construct(){
        parent::__construct();
    }
    public function detail(){
        $id = $this->uri->segment(1); // return 8
        $slug = $this->uri->segment(2); // return 77-anniversary
    }
}

In View

<a href="<?=base_url('8/77-anniversary');?>">Title</a>

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.