By yoeld on
Hi,
The link (l) function create a URL with various parameter.
Sometimes, I get a variable which is an URL produced by the l function. Is there a function that will enable to extract the various parameter out of it? It is possible to do this with a php loop but was wondering if there is a function doing that.
Thanks.
Comments
There isn’t. I can’t actually
There isn’t. I can’t actually come up with a scenario where you would want to that, either.
You will have to do some regex magic :)
This may not be what you
This may not be what you mean, but if you are trying to decode the raw data as it gets stored in the database, and therefore as it often appears in the data we have available to us, for example in the options column on the menu_links table, then you need to use the PHP function unserialize(). In order to store a complex data structure in the MySQL database, which can not record PHP structures, generally use is made of the PHP functions serialize() (change the structure to some kind of string with codes and values) and unserialize() (change that string back to a complex data structure).
Unserialize will take something like this:
a:1:{s:10:"attributes";a:1:{s:5:"title";s:47:"A nice title of some sort.";}}and turn it into this:
Even if your example is different, the PHP unserialize is likely what you need.