I can't detect the identifier editor
from the friendly URLs.
My friendly URLs have several categories, there is no exact number, some may have more, others may have fewer categories.
Example:
http://sitio.com/categoria1/categoría2/cat/cat/url-del-contenido-final/
By giving the user their publisher code pub-1374077Q
to register the referrals that were promoted from their identifier, as follows:
http://sitio.com/categoria1/categoría2/cat/cat/url-del-contenido-final/?publishers=pub-1374077Q
But it doesn't print me your identifier from the friendly url
$publishers = $_GET['publishers'];
echo $publishers;
From a normal URL:
http://sitio.com/index.php?publishers=pub-1374077Q
There it prints your identifierpub-1374077Q
But how can I get the publisher identifier from friendly URLs?
First we need to get the full URL:
So the best way to get what you want is to do it by using explode to remove a certain part of the url, in this case the ,
/?publishers=
and by using array_pop to get the last element at the end of the arraypub-1374077Q
.