How to get Controller, Action, URL informations with CodeIgniter

I have these urls:

How to get controller name, action name from these urls. I’m codeigniter newbie. Are there any helper function to get this info.

You could use the URI Class:

$this->uri->segment(n); // n=1 for controller, n=2 for method, etc

There is an optional second parameter that permits you to set your own default value if the segment is missing. For example, we could use

 $controllerName = $this->uri->segment(1, 'magazine');  

I’ve also been told that the following work, but am currently unable to test:


Convert plain text url’s to clickable links

Just copy this function and make your links clickable

function plain_url_to_link($string) {
    return preg_replace(
    '<a target="blank" rel="nofollow" href="$0" target="_blank">$0</a>', $string);
$str = " is a search website, you can also visit and";
echo plain_url_to_link($str);

Get the URL, time and content in WordPress without displaying it

The URL’s of our posts in WordPress looks like:

Using the_permalink() would generate the link but if you want to get the link only and don’t want it to get displayed, what should we do ?

A lot of of the WordPress function have ‘return’ alternates using get as the operative word.

get_the_permalink() - To get the link
get_the_time() - To get the time
get_the_content() - To get the content

How to remove index.php from url in magento

In Magento if you are getting the url as and you want that index.php is not written on the url i.e.

Then use the following steps:

1) Login to admin section by using the URL

2) Then go to “System >>  Configuration >>Web >> Search Engines Optimization”
Use Web Server Rewrites : YES

3) Go to “System >>  Configuration >>Web >>Secure”
Use secure URL Frontend: YES