Really thanks!
Your code works. But I have another little problem.
I get the data from a url like this: www.myurl.com/file.php?elements="a,cat5,cat1,cat1,cat8,a"
then in my php file I do this:
$list="('".ereg_replace(",","','",$elements)."')";
and I have this:
('\"a','cat5','cat1','cat1','cat8','a\"');
The problem is that if I write as you said
$thelist = array('\"a','categoria5','categoria1','categoria1','categoria8','a\"');
everything works, but if my code is something like:
$thelist = array($list);
it doesn't work. :-(
I don't understand why?
Can you please help me?
Thanks!