rajmohan Posted August 29, 2006 Share Posted August 29, 2006 Hai guys i need a help now in my project i want to get the last [b]index.php[/b] from below one (http://localhost/mohan/Aug06/26Aug06/gallery/admin/index.php), not only index.php there are lot of files are there how to get the last one Link to comment https://forums.phpfreaks.com/topic/19003-how-to-get-the-last-string-position/ Share on other sites More sharing options...
Jenk Posted August 29, 2006 Share Posted August 29, 2006 Read up on mod_rewrite for Apache.And if you are using that as a string within your script, rather than a url:[code]<?php$url = 'http://localhost/mohan/Aug06/26Aug06/gallery/admin/index.php';$page = substr($url, strrpos($url, '/') + 1);?>[/code] Link to comment https://forums.phpfreaks.com/topic/19003-how-to-get-the-last-string-position/#findComment-82128 Share on other sites More sharing options...
rajmohan Posted August 29, 2006 Author Share Posted August 29, 2006 Thank jank i am realy happy ya . Is there any method available Link to comment https://forums.phpfreaks.com/topic/19003-how-to-get-the-last-string-position/#findComment-82130 Share on other sites More sharing options...
onlyican Posted August 29, 2006 Share Posted August 29, 2006 of if you want the page name$_SERVER['SCRIPT_NAME'];which will return /index.php Link to comment https://forums.phpfreaks.com/topic/19003-how-to-get-the-last-string-position/#findComment-82133 Share on other sites More sharing options...
rajmohan Posted August 29, 2006 Author Share Posted August 29, 2006 yes it is working friend Link to comment https://forums.phpfreaks.com/topic/19003-how-to-get-the-last-string-position/#findComment-82160 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.