So I need to run a serialization and then htmlspecialchars w/ ENT_QUOTES to make it safe for both a url as well as linking to that url in HTML / javascript.

I'mmm having problems decoding when I add in the ENT_QUOTES portion...

Code PHP:
htmlspecialchars(serialize($my_array), ENT_QUOTES);
unserialize(htmlspecialchars_decode($this->getRequest()->getParam("details"))); //first line is posted to new script

I've trid the decode with the ENT_QUOTES argument, as well as messed with htmlentities with no avail. I don't think it'll be necessary to provide the data within the array, just know that it has apostrophes