Need help in displaying only the last array from the following code:
$string = "localhost/project/vanilla_2/index.php?p=/discussions/MostCommented";
/* Use tab and newline as tokenizing characters as well */
$tok = strtok($string, "/");
while ($tok !== false) {
echo "Word=$tok<br />";
$tok = strtok("/");
as of now I am getting the following result:
Word=localhost
Word=project
Word=vanilla_2
Word=index.php?p=
Word=discussions
Word=MostCommented
Question: How to get only the last result? (MostCommented)
Thanks