Jump to content


Photo

how to get the last string position?


  • Please log in to reply
4 replies to this topic

#1 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 29 August 2006 - 12:03 PM

Hai guys i need a help now in my project i want to get the last index.php from below one (http://localhost/moh...admin/index.php), not only index.php there are lot of files are there how to get the last one



#2 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 29 August 2006 - 12:13 PM

Read up on mod_rewrite for Apache.

And if you are using that as a string within your script, rather than a url:

<?php

$url = 'http://localhost/mohan/Aug06/26Aug06/gallery/admin/index.php';
$page = substr($url, strrpos($url, '/') + 1);

?>


#3 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 29 August 2006 - 12:16 PM

Thank jank i am realy happy ya . Is there any method available

#4 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 29 August 2006 - 12:19 PM

of if you want the page name

$_SERVER['SCRIPT_NAME'];
which will return /index.php
Tell me the problem, I will try tell you the solution

#5 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 29 August 2006 - 01:00 PM

yes it is working friend




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users