which of the following is more efficient?
-
Using a get function on a token (random), for example:
http://www.example.com/category/subcategory/subsubcategory?value=random
$_GET['value'] -
Make the token part of the URL and parse it, for example:
$url="http://www.example.com/category/subcategory/subsubcategory/random"
basename($url)
And actually, is basename more efficient than using explode or substr(strrchr())?
$_GET is obviously more efficient, since it doesn’t compute anything
Still, unless you plan on calling that a few thousand times in your script, it’s negligible so use whatever you feel works better.